Skip to content

Instantly share code, notes, and snippets.

@hiroyuki-sato
Created June 23, 2020 12:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hiroyuki-sato/fb8cfb38ec730e8b2772d759b697794a to your computer and use it in GitHub Desktop.
Save hiroyuki-sato/fb8cfb38ec730e8b2772d759b697794a to your computer and use it in GitHub Desktop.
embulk test
in:
  type: file
  path_prefix: /private/tmp/hoge/csv/sample_
  decoders:
  - {type: gzip}
  parser:
    charset: UTF-8
    newline: LF
    type: csv
    delimiter: ','
    quote: '"'
    escape: '"'
    null_string: 'NULL'
    trim_if_not_quoted: false
    skip_header_lines: 1
    allow_extra_columns: false
    allow_optional_columns: false
    columns:
    - {name: id, type: long}
    - {name: account, type: long}
    - {name: time, type: timestamp, format: '%Y-%m-%d %H:%M:%S'}
    - {name: purchase, type: timestamp, format: '%Y%m%d'}
    - {name: comment, type: string}
filters:
  - type: ruby_proc
    columns:
    - name: id
      proc: |-
        ->(id) do
          raise ConfigError.new "test test test test" if id == 3
          id
        end
out: {type: stdout}
2020-06-23 21:17:51.104 +0900: Embulk v0.9.23
2020-06-23 21:17:52.419 +0900 [WARN] (main): DEPRECATION: JRuby org.jruby.embed.ScriptingContainer is directly injected.
2020-06-23 21:17:55.579 +0900 [INFO] (main): Gem's home and path are set by default: "/Users/user/.embulk/lib/gems"
2020-06-23 21:17:57.320 +0900 [INFO] (main): Started Embulk v0.9.23
2020-06-23 21:17:57.526 +0900 [INFO] (0001:transaction): Loaded plugin embulk-filter-ruby_proc (0.8.1)
2020-06-23 21:17:57.582 +0900 [INFO] (0001:transaction): Listing local files at directory '/private/tmp/hoge/csv' filtering filename by prefix 'sample_'
2020-06-23 21:17:57.584 +0900 [INFO] (0001:transaction): "follow_symlinks" is set false. Note that symbolic links to directories are skipped.
2020-06-23 21:17:57.586 +0900 [INFO] (0001:transaction): Loading files [/private/tmp/hoge/csv/sample_01.csv.gz]
2020-06-23 21:17:57.708 +0900 [INFO] (0001:transaction): Using local thread executor with max_threads=8 / output tasks 4 = input tasks 1 * 4
2020-06-23 21:17:57.721 +0900 [INFO] (0001:transaction): {done:  0 / 1, running: 0}
org.embulk.deps.buffer.PooledBufferAllocatorImpl$BufferDoubleReleasedException: A Buffer detected double release() calls. The buffer has already been released at:
	at org.embulk.deps.buffer.PooledBufferAllocatorImpl$BufferBasedOnNettyByteBuf.release(PooledBufferAllocatorImpl.java:40)
	at org.embulk.spi.Page.release(Page.java:68)
	at org.embulk.exec.LocalExecutorPlugin$ScatterTransactionalPageOutput$OutputWorker.call(LocalExecutorPlugin.java:360)
	at org.embulk.exec.LocalExecutorPlugin$ScatterTransactionalPageOutput$OutputWorker.call(LocalExecutorPlugin.java:291)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.Throwable
	at org.embulk.deps.buffer.PooledBufferAllocatorImpl$BufferBasedOnNettyByteBuf.release(PooledBufferAllocatorImpl.java:45)
	at org.embulk.spi.PageReader.close(PageReader.java:151)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:438)
	at org.jruby.javasupport.JavaMethod.invokeDirect(JavaMethod.java:302)
	at org.jruby.java.invokers.InstanceMethodInvoker.call(InstanceMethodInvoker.java:36)
	at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:298)
	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:127)
	at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:344)
	at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
	at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:109)
	at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:95)
	at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:278)
	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:79)
	at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:84)
	at org.jruby.ir.instructions.CallBase.interpret(CallBase.java:429)
	at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:360)
	at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
	at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:84)
	at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:179)
	at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:165)
	at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:200)
	at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:318)
	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:155)
	at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:315)
	at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
	at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:109)
	at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:95)
	at Embulk$$FilterPlugin$$JavaAdapter$$OutputAdapter_1063755613.add(Embulk$$FilterPlugin$$JavaAdapter$$OutputAdapter_1063755613.gen:13)
	at org.embulk.exec.LocalExecutorPlugin$ScatterTransactionalPageOutput$OutputWorker.call(LocalExecutorPlugin.java:351)
	... 5 more
2020-06-23 21:17:57.948 +0900 [INFO] (0001:transaction): {done:  1 / 1, running: 0}
org.embulk.exec.PartialExecutionException: org.jruby.proxy.org.embulk.config.ConfigException$Proxy1: test test test test
	at org.embulk.exec.BulkLoader$LoaderState.buildPartialExecuteException(BulkLoader.java:340)
	at org.embulk.exec.BulkLoader.doRun(BulkLoader.java:566)
	at org.embulk.exec.BulkLoader.access$000(BulkLoader.java:35)
	at org.embulk.exec.BulkLoader$1.run(BulkLoader.java:353)
	at org.embulk.exec.BulkLoader$1.run(BulkLoader.java:350)
	at org.embulk.spi.Exec.doWith(Exec.java:22)
	at org.embulk.exec.BulkLoader.run(BulkLoader.java:350)
	at org.embulk.EmbulkEmbed.run(EmbulkEmbed.java:242)
	at org.embulk.EmbulkRunner.runInternal(EmbulkRunner.java:291)
	at org.embulk.EmbulkRunner.run(EmbulkRunner.java:155)
	at org.embulk.cli.EmbulkRun.runSubcommand(EmbulkRun.java:431)
	at org.embulk.cli.EmbulkRun.run(EmbulkRun.java:90)
	at org.embulk.cli.Main.main(Main.java:64)
Caused by: org.jruby.proxy.org.embulk.config.ConfigException$Proxy1: test test test test
	at java.lang.reflect.Constructor.newInstance(java/lang/reflect/Constructor.java:423)
	at org.jruby.javasupport.proxy.JavaProxyConstructor.newInstanceImpl(org/jruby/javasupport/proxy/JavaProxyConstructor.java:119)
	at org.jruby.javasupport.proxy.JavaProxyConstructor.newInstance(org/jruby/javasupport/proxy/JavaProxyConstructor.java:205)
	at org.jruby.javasupport.Java$JCreateMethod.call(org/jruby/javasupport/Java.java:618)
	at RUBY.transaction(uri:classloader:/gems/embulk-0.9.23-java/lib/embulk/filter_plugin.rb:54)
	at org.jruby.RubyClass.newInstance(org/jruby/RubyClass.java:1001)
	at org.jruby.RubyClass$INVOKER$i$newInstance.call(org/jruby/RubyClass$INVOKER$i$newInstance.gen)
	at RUBY.block in transaction(/Users/user/.embulk/lib/gems/gems/embulk-filter-ruby_proc-0.8.1/lib/embulk/filter/ruby_proc.rb:113)
	at org.jruby.RubyProc.call(org/jruby/RubyProc.java:289)
	at org.jruby.RubyProc.call19(org/jruby/RubyProc.java:273)
	at org.jruby.RubyProc$INVOKER$i$0$0$call19.call(org/jruby/RubyProc$INVOKER$i$0$0$call19.gen)
	at RUBY.block in transaction(uri:classloader:/gems/embulk-0.9.23-java/lib/embulk/filter_plugin.rb:51)
	at org.jruby.RubyHash$12.visit(org/jruby/RubyHash.java:1362)
	at org.jruby.RubyHash$12.visit(org/jruby/RubyHash.java:1359)
	at org.jruby.RubyHash.visitLimited(org/jruby/RubyHash.java:662)
	at org.jruby.RubyHash.visitAll(org/jruby/RubyHash.java:647)
	at org.jruby.RubyHash.iteratorVisitAll(org/jruby/RubyHash.java:1319)
	at org.jruby.RubyHash.each_pairCommon(org/jruby/RubyHash.java:1354)
	at org.jruby.RubyHash.each(org/jruby/RubyHash.java:1343)
	at org.jruby.RubyHash$INVOKER$i$0$0$each.call(org/jruby/RubyHash$INVOKER$i$0$0$each.gen)
	at RUBY.block in (:1)
	at org.jruby.RubyContinuation.enter(org/jruby/RubyContinuation.java:107)
	at org.jruby.RubyKernel.rbCatch19Common(org/jruby/RubyKernel.java:1121)
	at org.jruby.RubyKernel.catch(org/jruby/RubyKernel.java:1114)
	at org.jruby.RubyKernel$INVOKER$s$rbCatch19.call(org/jruby/RubyKernel$INVOKER$s$rbCatch19.gen)
	at RUBY.block in (:1)
	at org.jruby.RubyArray.each(org/jruby/RubyArray.java:1735)
	at org.jruby.RubyArray$INVOKER$i$0$0$each.call(org/jruby/RubyArray$INVOKER$i$0$0$each.gen)
	at Embulk$$FilterPlugin$$JavaAdapter$$OutputAdapter_1063755613.add(Embulk$$FilterPlugin$$JavaAdapter$$OutputAdapter_1063755613.gen:13)
	at org.embulk.exec.LocalExecutorPlugin$ScatterTransactionalPageOutput$OutputWorker.call(org/embulk/exec/LocalExecutorPlugin.java:351)
	at org.embulk.exec.LocalExecutorPlugin$ScatterTransactionalPageOutput$OutputWorker.call(org/embulk/exec/LocalExecutorPlugin.java:291)
	at java.util.concurrent.FutureTask.run(java/util/concurrent/FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(java/util/concurrent/ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(java/util/concurrent/ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(java/lang/Thread.java:748)

Error: org.jruby.proxy.org.embulk.config.ConfigException$Proxy1: test test test test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment