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

Error when storing JSON data in SUPER column #156

Open
vnktsh opened this issue Mar 22, 2024 · 4 comments
Open

Error when storing JSON data in SUPER column #156

vnktsh opened this issue Mar 22, 2024 · 4 comments

Comments

@vnktsh
Copy link

vnktsh commented Mar 22, 2024

Hi, does this package support Redshift's SUPER datatype?

I'm inserting a valid JSON data into SUPER column and getting following error:

java.sql.SQLException:
Error (code 1224) while loading data into Redshift: "Format with multiple values without array or object"
Table name: "PUBLIC"."telemetry_data"
Column name: telemetry
Column type: super(16384000)
Raw line: "{"created":"2024-03-16T18:22:56.258Z","deviceSerial":"5500TX-0000-0036","deviceId":"000799aa5b66","bundle":[{"category":"ExtTlsTelemetry","created":"2024-03-16T10:30:00.445Z","data":{"sslTierStats":{"rxSSLMbps":0,"rxSSLMaxMbps":0,"rxSSLPktsPerSec":0,"rxSSLMaxPktsPerSec":0,"txSSLMbps":0,"txSSLMaxMbps":0,"txSSLPktsPerSec":0,"txSSLMaxPktsPerSec":0},"npSslI...
Raw field value: "{"created":"2024-03-16T18:22:56.258Z","deviceSerial":"55036","deviceId":"00066","bundle":[{"category":"ExtTlsTelemetry","created":"2024-03-16T10:30:00.445Z","data":{"sslTierStats":{"rxSSLMbps":0,"rxSSLMaxMbps":0,"rxSSLPktsPerSec":0,"rxSSLMaxPktsPerSec":0,"txSSLMbps":0,"txSSLMaxMbps":0,"txSSLPktsPerSec":0,"txSSLMaxPktsPerSec":0},"npSslInspTrafficStats":{"clientBytesIn":0,"clientPacketsIn":0,"serverBytesIn":0,"serverPacketsIn":0,"clientBytesToD":0,"clientPacketsToD":0,"clientBytesToI":0,"clientPacketsToI":0,"serverBytesToD":0,"serverPacketsToD":0,"serverBytesToI":0,"serverPacketsToI":0},"npSslInspStats":{"sslConnections":0,"sslRuleConnections":0,"sslNoRuleConnections":0,"inspectedSessions":0,"shuntedSessions":0,"blockedMaxSslConnections":0,"allowedMaxSslConnections":0,"maxSessions":0,"percentMaxSessions":0,"blockedCriticalBigHeapUse":0,"allowedCriticalBigHeapUse":0},"sslConcurrentConnections":0,"sslProxyConfig":{"nUniqueCerts":0,"nUniqueCidrs":0,"serverAddresses":[],"certificateInfo":{}}}}]}"

  at io.github.spark_redshift_community.spark.redshift.RedshiftWriter.$anonfun$doRedshiftLoad$2(RedshiftWriter.scala:200)

This is the main error:
Error (code 1224) while loading data into Redshift: "Format with multiple values without array or object"

This is the data I'm trying to insert (valid json string):

{"created":"2024-03-16T18:22:56.258Z","deviceSerial":"55036","deviceId":"00066","bundle":[{"category":"ExtTlsTelemetry","created":"2024-03-16T10:30:00.445Z","data":{"sslTierStats":{"rxSSLMbps":0,"rxSSLMaxMbps":0,"rxSSLPktsPerSec":0,"rxSSLMaxPktsPerSec":0,"txSSLMbps":0,"txSSLMaxMbps":0,"txSSLPktsPerSec":0,"txSSLMaxPktsPerSec":0},"npSslInspTrafficStats":{"clientBytesIn":0,"clientPacketsIn":0,"serverBytesIn":0,"serverPacketsIn":0,"clientBytesToD":0,"clientPacketsToD":0,"clientBytesToI":0,"clientPacketsToI":0,"serverBytesToD":0,"serverPacketsToD":0,"serverBytesToI":0,"serverPacketsToI":0},"npSslInspStats":{"sslConnections":0,"sslRuleConnections":0,"sslNoRuleConnections":0,"inspectedSessions":0,"shuntedSessions":0,"blockedMaxSslConnections":0,"allowedMaxSslConnections":0,"maxSessions":0,"percentMaxSessions":0,"blockedCriticalBigHeapUse":0,"allowedCriticalBigHeapUse":0},"sslConcurrentConnections":0,"sslProxyConfig":{"nUniqueCerts":0,"nUniqueCidrs":0,"serverAddresses":[],"certificateInfo":{}}}}]}

This is my corresponding DDL for table PUBLIC.telemetry_data:

create table public.telemetry_data
(
    telemetry     super encode zstd
);

Environment details

Package version:

        <dependency>
            <groupId>io.github.spark-redshift-community</groupId>
            <artifactId>spark-redshift_2.12</artifactId>
            <version>6.2.0-spark_3.5</version>
        </dependency>
@melin
Copy link

melin commented Mar 28, 2024

Also encountered a similar error, is there a solution?
STL_LOAD_ERRORS.csv

@melin
Copy link

melin commented Apr 15, 2024

Similar to sql, the execution of glue elt(spark) was successful, but the migration to serverless failed. glue dynamically registers schemas.
How does super automatically register schema?

cc @bsharifi

@vannguyende
Copy link

the same issue. Is there any solution?

@bsharifi
Copy link
Collaborator

bsharifi commented Jul 9, 2024

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

No branches or pull requests

4 participants