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

Destination Snowflake: Handle NPE for state value. #35899

Merged
merged 5 commits into from
Mar 7, 2024

Conversation

gisripa
Copy link
Contributor

@gisripa gisripa commented Mar 7, 2024

@gisripa gisripa requested a review from a team as a code owner March 7, 2024 19:21
Copy link

vercel bot commented Mar 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
airbyte-docs ⬜️ Ignored (Inspect) Visit Preview Mar 7, 2024 9:48pm

@octavia-squidington-iii octavia-squidington-iii added area/connectors Connector related issues CDK Connector Development Kit connectors/destination/snowflake labels Mar 7, 2024
@gisripa
Copy link
Contributor Author

gisripa commented Mar 7, 2024

/publish-java-cdk

🕑 https://github.com/airbytehq/airbyte/actions/runs/8194156891
✅ Successfully published Java CDK version=0.23.18!

@octavia-squidington-iii octavia-squidington-iii added the area/documentation Improvements or additions to documentation label Mar 7, 2024
@gisripa gisripa enabled auto-merge (squash) March 7, 2024 20:59
@gisripa gisripa merged commit 55e6fbd into master Mar 7, 2024
31 checks passed
@gisripa gisripa deleted the gireesh/jdbc-npe-fix branch March 7, 2024 22:25
@GKTheOne
Copy link

GKTheOne commented Mar 7, 2024

Now the connector errors:

2024-03-07 23:26:39 destination > ERROR main i.a.c.i.b.AirbyteExceptionHandler(uncaughtException):64 Something went wrong in the connector. See the logs for more details. java.lang.IllegalStateException: Duplicate key _null (attempted merging values SnowflakeState(needsSoftReset=false) and SnowflakeState(needsSoftReset=false))
        at java.base/java.util.stream.Collectors.duplicateKeyException(Collectors.java:135) ~[?:?]
        at java.base/java.util.stream.Collectors.lambda$uniqKeysMapAccumulator$1(Collectors.java:182) ~[?:?]
        at java.base/java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169) ~[?:?]
        at java.base/java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(AbstractList.java:722) ~[?:?]
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
        at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) ~[?:?]
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
        at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682) ~[?:?]
        at io.airbyte.cdk.integrations.destination.jdbc.typing_deduping.JdbcDestinationHandler.getAllDestinationStates(JdbcDestinationHandler.java:220) ~[airbyte-cdk-db-destinations-0.23.18.jar:?]
        at io.airbyte.integrations.destination.snowflake.typing_deduping.SnowflakeDestinationHandler.gatherInitialState(SnowflakeDestinationHandler.java:286) ~[io.airbyte.airbyte-integrations.connectors-destination-snowflake.jar:?]
        at io.airbyte.integrations.base.destination.typing_deduping.NoOpTyperDeduperWithV1V2Migrations.prepareSchemasAndRunMigrations(NoOpTyperDeduperWithV1V2Migrations.java:71) ~[airbyte-cdk-typing-deduping-0.23.18.jar:?]
        at io.airbyte.cdk.integrations.destination.staging.GeneralStagingFunctions.lambda$onStartFunction$0(GeneralStagingFunctions.java:43) ~[airbyte-cdk-db-destinations-0.23.18.jar:?]
        at io.airbyte.commons.concurrency.VoidCallable.call(VoidCallable.java:15) ~[airbyte-cdk-dependencies-0.23.18.jar:?]
        at io.airbyte.cdk.integrations.destination_async.AsyncStreamConsumer.start(AsyncStreamConsumer.java:139) ~[airbyte-cdk-core-0.23.18.jar:?]
        at io.airbyte.cdk.integrations.base.IntegrationRunner.consumeWriteStream(IntegrationRunner.java:298) ~[airbyte-cdk-core-0.23.18.jar:?]
        at io.airbyte.cdk.integrations.base.IntegrationRunner.consumeWriteStream(IntegrationRunner.java:289) ~[airbyte-cdk-core-0.23.18.jar:?]
        at io.airbyte.cdk.integrations.base.IntegrationRunner.runInternal(IntegrationRunner.java:190) ~[airbyte-cdk-core-0.23.18.jar:?]
        at io.airbyte.cdk.integrations.base.IntegrationRunner.run(IntegrationRunner.java:125) ~[airbyte-cdk-core-0.23.18.jar:?]
        at io.airbyte.cdk.integrations.base.adaptive.AdaptiveDestinationRunner$Runner.run(AdaptiveDestinationRunner.java:88) ~[airbyte-cdk-core-0.23.18.jar:?]
        at io.airbyte.integrations.destination.snowflake.SnowflakeDestinationRunner.main(SnowflakeDestinationRunner.java:20) ~[io.airbyte.airbyte-integrations.connectors-destination-snowflake.jar:?]

Stack Trace: java.lang.IllegalStateException: Duplicate key _null (attempted merging values SnowflakeState(needsSoftReset=false) and SnowflakeState(needsSoftReset=false))
        at java.base/java.util.stream.Collectors.duplicateKeyException(Collectors.java:135)
        at java.base/java.util.stream.Collectors.lambda$uniqKeysMapAccumulator$1(Collectors.java:182)
        at java.base/java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)
        at java.base/java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(AbstractList.java:722)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
        at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
        at io.airbyte.cdk.integrations.destination.jdbc.typing_deduping.JdbcDestinationHandler.getAllDestinationStates(JdbcDestinationHandler.java:220)
        at io.airbyte.integrations.destination.snowflake.typing_deduping.SnowflakeDestinationHandler.gatherInitialState(SnowflakeDestinationHandler.java:286)
        at io.airbyte.integrations.base.destination.typing_deduping.NoOpTyperDeduperWithV1V2Migrations.prepareSchemasAndRunMigrations(NoOpTyperDeduperWithV1V2Migrations.java:71)
        at io.airbyte.cdk.integrations.destination.staging.GeneralStagingFunctions.lambda$onStartFunction$0(GeneralStagingFunctions.java:43)
        at io.airbyte.commons.concurrency.VoidCallable.call(VoidCallable.java:15)
        at io.airbyte.cdk.integrations.destination_async.AsyncStreamConsumer.start(AsyncStreamConsumer.java:139)
        at io.airbyte.cdk.integrations.base.IntegrationRunner.consumeWriteStream(IntegrationRunner.java:298)
        at io.airbyte.cdk.integrations.base.IntegrationRunner.consumeWriteStream(IntegrationRunner.java:289)
        at io.airbyte.cdk.integrations.base.IntegrationRunner.runInternal(IntegrationRunner.java:190)
        at io.airbyte.cdk.integrations.base.IntegrationRunner.run(IntegrationRunner.java:125)
        at io.airbyte.cdk.integrations.base.adaptive.AdaptiveDestinationRunner$Runner.run(AdaptiveDestinationRunner.java:88)
        at io.airbyte.integrations.destination.snowflake.SnowflakeDestinationRunner.main(SnowflakeDestinationRunner.java:20)

@evantahler
Copy link
Contributor

evantahler commented Mar 11, 2024

@GKTheOne - can you please open a new issue, and share what source you are using? That error is saying that somehow the source produced 2 columns of the same name (_null). Also, null_ is a terrible column name

Please add screenshots of the connection setup page showing all columns in the stream.

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

Successfully merging this pull request may close these issues.

6 participants