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

SNOW-1479614: No enum constant net.snowflake.client.jdbc.SnowflakeType. #1790

Closed
akashkhamkarr opened this issue Jun 13, 2024 · 7 comments
Closed
Assignees
Labels
bug status-fixed_awaiting_release The issue has been fixed, its PR merged, and now awaiting the next release cycle of the connector. status-triage_done Initial triage done, will be further handled by the driver team

Comments

@akashkhamkarr
Copy link

akashkhamkarr commented Jun 13, 2024

Please answer these questions before submitting your issue.
In order to accurately debug the issue this information is required. Thanks!

  1. What version of JDBC driver are you using?
    3.16.1

  2. What operating system and processor architecture are you using?
    NA

  3. What version of Java are you using?
    11

  4. What did you do?
    a. Fetched database columns using connection.metaData.getColumns(databaseName, null, null, null)
    b. Kept iterating over the rs jdbcResultSet, during which i called rs.next() to check if any more rows are left.
    c. Here i got the exception No enum constant net.snowflake.client.jdbc.SnowflakeType.

For the time being, we can't check the actual column data type on the snowflake, for which this has happened

Relevant stacktrace:

Exception in thread "main" java.lang.IllegalArgumentException: No enum constant net.snowflake.client.jdbc.SnowflakeType.
        at java.base/java.lang.Enum.valueOf(Unknown Source)
        at net.snowflake.client.jdbc.SnowflakeType.valueOf(SnowflakeType.java:23)
        at net.snowflake.client.jdbc.SnowflakeType.fromString(SnowflakeType.java:54)
        at net.snowflake.client.jdbc.SnowflakeUtil.getSnowflakeType(SnowflakeUtil.java:236)
        at net.snowflake.client.jdbc.SnowflakeUtil.createFieldsMetadata(SnowflakeUtil.java:404)
        at net.snowflake.client.jdbc.SnowflakeUtil.getFieldMetadata(SnowflakeUtil.java:437)
        at net.snowflake.client.jdbc.SnowflakeUtil.extractColumnMetadata(SnowflakeUtil.java:191)
        at net.snowflake.client.jdbc.SnowflakeDatabaseMetaData$4.next(SnowflakeDatabaseMetaData.java:1819)

I believe the datatype being received is empty

  1. What did you expect to see?
    a. either a default datatype value to get assign to such empty fields, or a proper parsing of the correct datatype

  2. Can you set logging to DEBUG and collect the logs?
    a. Can try if required
    https://community.snowflake.com/s/article/How-to-generate-log-file-on-Snowflake-connectors

  3. What is your Snowflake account identifier, if any? (Optional)
    NA

@github-actions github-actions bot changed the title No enum constant net.snowflake.client.jdbc.SnowflakeType. SNOW-1479614: No enum constant net.snowflake.client.jdbc.SnowflakeType. Jun 13, 2024
@sfc-gh-wfateem sfc-gh-wfateem self-assigned this Jun 13, 2024
@sfc-gh-wfateem sfc-gh-wfateem added the status-triage Issue is under initial triage label Jun 13, 2024
@sfc-gh-wfateem
Copy link
Collaborator

Hi @akashkhamkarr,

Thanks for creating the issue. Is there anything else you can do to try and narrow down the problem? For example, is it feasible for you to run that test on specific tables, or schemas at least?
Was this working on a version older than 3.16.1, or did you just happen to run this code starting with that version?
In the meantime, I'll take a look to see what I can figure out based on that error stack you shared.

@akashkhamkarr
Copy link
Author

akashkhamkarr commented Jun 17, 2024

@sfc-gh-wfateem Hi, i was able to figure out for which data type its happening

So far its happening over the structured objects columns

steps to reproduce

  1. Create an iceberg table with a structured object column (not normal object, it needs to be a structured object)
  2. Try fetching columns for the parent database, using .getColumns(databaseName, null, null, null)

@akashkhamkarr
Copy link
Author

@sfc-gh-wfateem any updates on this ?

@sfc-gh-wfateem
Copy link
Collaborator

Hi @akashkhamkarr,

I apologize for the delay. I've been out for a while and just getting back to my backlog.
I just looked over this, and I was able to reproduce the issue. I'll discuss this with the rest of the team to try to address it as soon as possible. Thanks for your patience.

@sfc-gh-wfateem sfc-gh-wfateem added status-triage_done Initial triage done, will be further handled by the driver team and removed status-triage Issue is under initial triage labels Jul 9, 2024
@sfc-gh-wfateem
Copy link
Collaborator

@akashkhamkarr PR #1831 is merged and will fix this issue in the next release.
Thanks for your patience!

@sfc-gh-wfateem sfc-gh-wfateem added the status-fixed_awaiting_release The issue has been fixed, its PR merged, and now awaiting the next release cycle of the connector. label Jul 18, 2024
@akashkhamkarr
Copy link
Author

Awesome, thank you @sfc-gh-wfateem

@sfc-gh-wfateem
Copy link
Collaborator

@akashkhamkarr JDBC driver version 3.18.0 has been released with the fix for this issue.
Please give that a try and let us know if you still have any issues with this.
I will go ahead and close this issue for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug status-fixed_awaiting_release The issue has been fixed, its PR merged, and now awaiting the next release cycle of the connector. status-triage_done Initial triage done, will be further handled by the driver team
Projects
None yet
Development

No branches or pull requests

2 participants