andygrove commented on code in PR #3875:
URL: https://github.com/apache/datafusion-comet/pull/3875#discussion_r3125611507


##########
spark/src/test/resources/sql-tests/expressions/struct/structs_to_json.sql:
##########
@@ -16,14 +16,22 @@
 -- under the License.
 
 statement
-CREATE TABLE test_to_json(a int, b string) USING parquet
+CREATE TABLE test_to_json(a int, b string, f float, d double) USING parquet
 
 statement
-INSERT INTO test_to_json VALUES (1, 'hello'), (NULL, NULL), (0, '')
+INSERT INTO test_to_json VALUES (1, 'hello', cast('NaN' as float), 
cast('Infinity' as double)), (NULL, NULL, NULL, NULL), (0, '', 0.0, 0.0)
 
 query spark_answer_only
-SELECT to_json(named_struct('a', a, 'b', b)) FROM test_to_json
+SELECT to_json(named_struct('a', a, 'b', b, 'f', f, 'd', d)) FROM test_to_json
 
 -- literal arguments
 query spark_answer_only
 SELECT to_json(named_struct('a', 1, 'b', 'hello'))
+
+-- query expect_fallback(StructsToJson with options is not supported)
+query ignore("Need support Spark 4.0.0")
+SELECT to_json(named_struct('a', a, 'b', b), map('timestampFormat', 
'dd/MM/yyyy'))
+
+-- query expect_fallback(Struct type: 
StructType(StructField(a,ArrayType(IntegerType,false),false)) contains 
unsupported types)
+query ignore("Need support Spark 4.0.0")
+SELECT to_json(named_struct(a, array(b)))

Review Comment:
   could you create a separate `structs_to_json_spark4.sql` for these tests and 
set min spark version 4 for that file, and change these to `expect_fallback`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to