Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insert into partitioned table fails with NPE if partition column not populated #4122

Closed
martint opened this issue Dec 8, 2015 · 1 comment
Labels

Comments

@martint
Copy link
Contributor

martint commented Dec 8, 2015

CREATE TABLE t (
    x varchar, 
    y varchar
) 
WITH (partitioned_by = ARRAY['y']);
INSERT INTO t (x) VALUES ('a');
java.lang.NullPointerException
    at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
    at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
    at com.facebook.presto.hive.HivePageSink.createWriter(HivePageSink.java:287)
    at com.facebook.presto.hive.HivePageSink.appendPage(HivePageSink.java:272)
    at com.facebook.presto.spi.classloader.ClassLoaderSafeConnectorPageSink.appendPage(ClassLoaderSafeConnectorPageSink.java:41)
    at com.facebook.presto.operator.TableWriterOperator.addInput(TableWriterOperator.java:176)
    at com.facebook.presto.operator.Driver.processInternal(Driver.java:386)
    at com.facebook.presto.operator.Driver.processFor(Driver.java:303)
    at com.facebook.presto.execution.SqlTaskExecution$DriverSplitRunner.processFor(SqlTaskExecution.java:587)
    at com.facebook.presto.execution.TaskExecutor$PrioritizedSplitRunner.process(TaskExecutor.java:505)
    at com.facebook.presto.execution.TaskExecutor$Runner.run(TaskExecutor.java:640)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

This piece of code in HivePageSink.createWriter() is the culprit:

List<String> partitionValues = partitionRow.stream()
    .map(Object::toString) // todo this seems wrong
    .collect(toList());
@martint martint added the bug label Dec 8, 2015
@yuananf
Copy link
Contributor

yuananf commented Dec 8, 2015

This is the same as #3860

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants