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

[BUG] FlintDataType cannot serialize TIMESTAMP_NTZ #593

Closed
engechas opened this issue Aug 21, 2024 · 2 comments
Closed

[BUG] FlintDataType cannot serialize TIMESTAMP_NTZ #593

engechas opened this issue Aug 21, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@engechas
Copy link
Contributor

What is the bug?
Creating a covering index against a field with the type TIMESTAMP_NTZ throws an exception during serialization in the FlintDataType class.

24/08/21 23:01:33 ERROR FlintSpark: Failed to execute index operation [Create Flint index flint_hurneyttestsource_amazon_security_lake_glue_db_us_east_1_amazon_security_lake_table_us_east_1_vpc_flow_2_0_hurneyttest1_index]
java.lang.IllegalStateException: unsupported data type: TIMESTAMP_NTZ
	at org.apache.spark.sql.flint.datatype.FlintDataType$.serializeField(FlintDataType.scala:166) ~[opensearch-spark-standalone_2.12-latest.jar:0.5.0-SNAPSHOT]
	at org.apache.spark.sql.flint.datatype.FlintDataType$.$anonfun$serializeJValue$1(FlintDataType.scala:121) ~[opensearch-spark-standalone_2.12-latest.jar:0.5.0-SNAPSHOT]
	at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:286) ~[scala-library-2.12.17.jar:?]
	at scala.collection.IndexedSeqOptimized.foreach(IndexedSeqOptimized.scala:36) ~[scala-library-2.12.17.jar:?]
	at scala.collection.IndexedSeqOptimized.foreach$(IndexedSeqOptimized.scala:33) ~[scala-library-2.12.17.jar:?]
	at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:198) ~[scala-library-2.12.17.jar:?]
	at scala.collection.TraversableLike.map(TraversableLike.scala:286) ~[scala-library-2.12.17.jar:?]
	at scala.collection.TraversableLike.map$(TraversableLike.scala:279) ~[scala-library-2.12.17.jar:?]
	at scala.collection.mutable.ArrayOps$ofRef.map(ArrayOps.scala:198) ~[scala-library-2.12.17.jar:?]
	at org.apache.spark.sql.flint.datatype.FlintDataType$.serializeJValue(FlintDataType.scala:121) ~[opensearch-spark-standalone_2.12-latest.jar:0.5.0-SNAPSHOT]
	at org.apache.spark.sql.flint.datatype.FlintDataType$.serialize(FlintDataType.scala:113) ~[opensearch-spark-standalone_2.12-latest.jar:0.5.0-SNAPSHOT]
	at org.opensearch.flint.spark.FlintSparkIndex$.generateSchemaJSON(FlintSparkIndex.scala:177) ~[opensearch-spark-standalone_2.12-latest.jar:0.5.0-SNAPSHOT]
	at org.opensearch.flint.spark.covering.FlintSparkCoveringIndex.metadata(FlintSparkCoveringIndex.scala:56) ~[opensearch-spark-standalone_2.12-latest.jar:0.5.0-SNAPSHOT]
	at org.opensearch.flint.spark.FlintSpark.$anonfun$createIndex$1(FlintSpark.scala:109) ~[opensearch-spark-standalone_2.12-latest.jar:0.5.0-SNAPSHOT]
	at org.opensearch.flint.spark.FlintSpark.$anonfun$createIndex$1$adapted(FlintSpark.scala:102) ~[opensearch-spark-standalone_2.12-latest.jar:0.5.0-SNAPSHOT]
	at org.opensearch.flint.spark.FlintSparkTransactionSupport.withTransaction(FlintSparkTransactionSupport.scala:52) ~[opensearch-spark-standalone_2.12-latest.jar:0.5.0-SNAPSHOT]
	at org.opensearch.flint.spark.FlintSparkTransactionSupport.withTransaction$(FlintSparkTransactionSupport.scala:44) ~[opensearch-spark-standalone_2.12-latest.jar:0.5.0-SNAPSHOT]
	at org.opensearch.flint.spark.FlintSpark.withTransaction(FlintSpark.scala:38) ~[opensearch-spark-standalone_2.12-latest.jar:0.5.0-SNAPSHOT]
	at org.opensearch.flint.spark.FlintSpark.createIndex(FlintSpark.scala:102) ~[opensearch-spark-standalone_2.12-latest.jar:0.5.0-SNAPSHOT]
	at org.opensearch.flint.spark.FlintSparkIndexBuilder.create(FlintSparkIndexBuilder.scala:63) ~[opensearch-spark-standalone_2.12-latest.jar:0.5.0-SNAPSHOT]
	at org.opensearch.flint.spark.sql.covering.FlintSparkCoveringIndexAstBuilder.$anonfun$visitCreateCoveringIndexStatement$1(FlintSparkCoveringIndexAstBuilder.scala:51) ~[opensearch-spark-standalone_2.12-latest.jar:0.5.0-SNAPSHOT]
	at org.opensearch.flint.spark.sql.FlintSparkSqlCommand.run(FlintSparkSqlCommand.scala:27) ~[opensearch-spark-standalone_2.12-latest.jar:0.5.0-SNAPSHOT]
	at org.apache.spark.sql.execution.command.ExecutedCommandExec.sideEffectResult$lzycompute(commands.scala:75) ~[spark-sql_2.12-3.5.1-amzn-0.jar:3.5.1-amzn-0]
	at org.apache.spark.sql.execution.command.ExecutedCommandExec.sideEffectResult(commands.scala:73) ~[spark-sql_2.12-3.5.1-amzn-0.jar:3.5.1-amzn-0]
	at org.apache.spark.sql.execution.command.ExecutedCommandExec.executeCollect(commands.scala:84) ~[spark-sql_2.12-3.5.1-amzn-0.jar:3.5.1-amzn-0]
	at org.apache.spark.sql.execution.QueryExecution$$anonfun$eagerlyExecuteCommands$1.$anonfun$applyOrElse$1(QueryExecution.scala:126) ~[spark-sql_2.12-3.5.1-amzn-0.jar:3.5.1-amzn-0]
	at org.apache.spark.sql.catalyst.QueryPlanningTracker$.withTracker(QueryPlanningTracker.scala:108) ~[spark-catalyst_2.12-3.5.1-amzn-0.jar:3.5.1-amzn-0]
	at org.apache.spark.sql.execution.SQLExecution$.withTracker(SQLExecution.scala:264) ~[spark-sql_2.12-3.5.1-amzn-0.jar:3.5.1-amzn-0]
	at org.apache.spark.sql.execution.SQLExecution$.executeQuery$1(SQLExecution.scala:138) ~[spark-sql_2.12-3.5.1-amzn-0.jar:3.5.1-amzn-0]
	at org.apache.spark.sql.execution.SQLExecution$.$anonfun$withNewExecutionId$9(SQLExecution.scala:174) ~[spark-sql_2.12-3.5.1-amzn-0.jar:3.5.1-amzn-0]
	at org.apache.spark.sql.catalyst.QueryPlanningTracker$.withTracker(QueryPlanningTracker.scala:108) ~[spark-catalyst_2.12-3.5.1-amzn-0.jar:3.5.1-amzn-0]
	at org.apache.spark.sql.execution.SQLExecution$.withTracker(SQLExecution.scala:264) ~[spark-sql_2.12-3.5.1-amzn-0.jar:3.5.1-amzn-0]
	at org.apache.spark.sql.execution.SQLExecution$.$anonfun$withNewExecutionId$8(SQLExecution.scala:174) ~[spark-sql_2.12-3.5.1-amzn-0.jar:3.5.1-amzn-0]
	at org.apache.spark.sql.execution.SQLExecution$.withSQLConfPropagated(SQLExecution.scala:285) ~[spark-sql_2.12-3.5.1-amzn-0.jar:3.5.1-amzn-0]
	at org.apache.spark.sql.execution.SQLExecution$.$anonfun$withNewExecutionId$1(SQLExecution.scala:173) ~[spark-sql_2.12-3.5.1-amzn-0.jar:3.5.1-amzn-0]
	at org.apache.spark.sql.SparkSession.withActive(SparkSession.scala:901) ~[spark-sql_2.12-3.5.1-amzn-0.jar:0.5.0-SNAPSHOT]
	at org.apache.spark.sql.execution.SQLExecution$.withNewExecutionId(SQLExecution.scala:70) ~[spark-sql_2.12-3.5.1-amzn-0.jar:3.5.1-amzn-0]
	at org.apache.spark.sql.execution.QueryExecution$$anonfun$eagerlyExecuteCommands$1.applyOrElse(QueryExecution.scala:123) ~[spark-sql_2.12-3.5.1-amzn-0.jar:3.5.1-amzn-0]
	at org.apache.spark.sql.execution.QueryExecution$$anonfun$eagerlyExecuteCommands$1.applyOrElse(QueryExecution.scala:114) ~[spark-sql_2.12-3.5.1-amzn-0.jar:3.5.1-amzn-0]
	at org.apache.spark.sql.catalyst.trees.TreeNode.$anonfun$transformDownWithPruning$1(TreeNode.scala:519) ~[spark-catalyst_2.12-3.5.1-amzn-0.jar:3.5.1-amzn-0]
	at org.apache.spark.sql.catalyst.trees.CurrentOrigin$.withOrigin(origin.scala:77) ~[spark-sql-api_2.12-3.5.1-amzn-0.jar:3.5.1-amzn-0]
	at org.apache.spark.sql.catalyst.trees.TreeNode.transformDownWithPruning(TreeNode.scala:519) ~[spark-catalyst_2.12-3.5.1-amzn-0.jar:3.5.1-amzn-0]
	at org.apache.spark.sql.catalyst.plans.logical.LogicalPlan.org$apache$spark$sql$catalyst$plans$logical$AnalysisHelper$$super$transformDownWithPruning(LogicalPlan.scala:34) ~[spark-catalyst_2.12-3.5.1-amzn-0.jar:3.5.1-amzn-0]
	at org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper.transformDownWithPruning(AnalysisHelper.scala:297) ~[spark-catalyst_2.12-3.5.1-amzn-0.jar:3.5.1-amzn-0]
	at org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper.transformDownWithPruning$(AnalysisHelper.scala:293) ~[spark-catalyst_2.12-3.5.1-amzn-0.jar:3.5.1-amzn-0]
	at org.apache.spark.sql.catalyst.plans.logical.LogicalPlan.transformDownWithPruning(LogicalPlan.scala:34) ~[spark-catalyst_2.12-3.5.1-amzn-0.jar:3.5.1-amzn-0]
	at org.apache.spark.sql.catalyst.plans.logical.LogicalPlan.transformDownWithPruning(LogicalPlan.scala:34) ~[spark-catalyst_2.12-3.5.1-amzn-0.jar:3.5.1-amzn-0]
	at org.apache.spark.sql.catalyst.trees.TreeNode.transformDown(TreeNode.scala:495) ~[spark-catalyst_2.12-3.5.1-amzn-0.jar:3.5.1-amzn-0]
	at org.apache.spark.sql.execution.QueryExecution.eagerlyExecuteCommands(QueryExecution.scala:114) ~[spark-sql_2.12-3.5.1-amzn-0.jar:3.5.1-amzn-0]
	at org.apache.spark.sql.execution.QueryExecution.commandExecuted$lzycompute(QueryExecution.scala:101) ~[spark-sql_2.12-3.5.1-amzn-0.jar:3.5.1-amzn-0]
	at org.apache.spark.sql.execution.QueryExecution.commandExecuted(QueryExecution.scala:99) ~[spark-sql_2.12-3.5.1-amzn-0.jar:3.5.1-amzn-0]
	at org.apache.spark.sql.Dataset.<init>(Dataset.scala:223) ~[spark-sql_2.12-3.5.1-amzn-0.jar:0.5.0-SNAPSHOT]
	at org.apache.spark.sql.Dataset$.$anonfun$ofRows$2(Dataset.scala:103) ~[spark-sql_2.12-3.5.1-amzn-0.jar:0.5.0-SNAPSHOT]
	at org.apache.spark.sql.SparkSession.withActive(SparkSession.scala:901) ~[spark-sql_2.12-3.5.1-amzn-0.jar:0.5.0-SNAPSHOT]
	at org.apache.spark.sql.Dataset$.ofRows(Dataset.scala:99) ~[spark-sql_2.12-3.5.1-amzn-0.jar:0.5.0-SNAPSHOT]
	at org.apache.spark.sql.SparkSession.$anonfun$sql$4(SparkSession.scala:692) ~[spark-sql_2.12-3.5.1-amzn-0.jar:0.5.0-SNAPSHOT]
	at org.apache.spark.sql.SparkSession.withActive(SparkSession.scala:901) [spark-sql_2.12-3.5.1-amzn-0.jar:0.5.0-SNAPSHOT]
	at org.apache.spark.sql.SparkSession.sql(SparkSession.scala:683) [spark-sql_2.12-3.5.1-amzn-0.jar:0.5.0-SNAPSHOT]
	at org.apache.spark.sql.SparkSession.sql(SparkSession.scala:714) [spark-sql_2.12-3.5.1-amzn-0.jar:0.5.0-SNAPSHOT]
	at org.apache.spark.sql.SparkSession.sql(SparkSession.scala:745) [spark-sql_2.12-3.5.1-amzn-0.jar:0.5.0-SNAPSHOT]
	at org.apache.spark.sql.FlintJobExecutor.executeQuery(FlintJobExecutor.scala:409) [opensearch-spark-sql-application_2.12-latest.jar:0.5.0-SNAPSHOT]
	at org.apache.spark.sql.FlintJobExecutor.executeQuery$(FlintJobExecutor.scala:398) [opensearch-spark-sql-application_2.12-latest.jar:0.5.0-SNAPSHOT]
	at org.apache.spark.sql.JobOperator.executeQuery(JobOperator.scala:24) [opensearch-spark-sql-application_2.12-latest.jar:0.5.0-SNAPSHOT]
	at org.apache.spark.sql.JobOperator.start(JobOperator.scala:54) [opensearch-spark-sql-application_2.12-latest.jar:0.5.0-SNAPSHOT]
	at org.apache.spark.sql.FlintJob$.main(FlintJob.scala:65) [opensearch-spark-sql-application_2.12-latest.jar:0.5.0-SNAPSHOT]
	at org.apache.spark.sql.FlintJob.main(FlintJob.scala) [opensearch-spark-sql-application_2.12-latest.jar:0.5.0-SNAPSHOT]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
	at org.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52) [spark-core_2.12-3.5.1-amzn-0.jar:3.5.1-amzn-0]
	at org.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:1075) [spark-core_2.12-3.5.1-amzn-0.jar:3.5.1-amzn-0]
	at org.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:194) [spark-core_2.12-3.5.1-amzn-0.jar:3.5.1-amzn-0]
	at org.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:217) [spark-core_2.12-3.5.1-amzn-0.jar:3.5.1-amzn-0]
	at org.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:91) [spark-core_2.12-3.5.1-amzn-0.jar:3.5.1-amzn-0]
	at org.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1167) [spark-core_2.12-3.5.1-amzn-0.jar:3.5.1-amzn-0]
	at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1176) [spark-core_2.12-3.5.1-amzn-0.jar:3.5.1-amzn-0]
	at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala) [spark-core_2.12-3.5.1-amzn-0.jar:3.5.1-amzn-0]

How can one reproduce the bug?
Steps to reproduce the behavior:

  1. Create a covering index against a timestamp field in an Iceberg table

What is the expected behavior?
TIMESTAMP_NTZ should be supported and the CI should be created successfully.

What is your host/environment?

  • Version 0.5.0

Do you have any screenshots?
If applicable, add screenshots to help explain your problem.

Do you have any additional context?
Add any other context about the problem.

@engechas engechas added bug Something isn't working untriaged labels Aug 21, 2024
@dblock dblock removed the untriaged label Sep 9, 2024
@dblock
Copy link
Member

dblock commented Sep 9, 2024

[Catch All Triage - 1, 2, 3, 4, 5]

@engechas
Copy link
Contributor Author

Resolved by #673

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants