Details
-
New Feature
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
None
-
None
Description
https://spark.apache.org/docs/3.4.0/api/sql/index.html#named_struct
spark.sql("""select named_struct("a", 1, "b", 2)""") res4: org.apache.spark.sql.DataFrame = [named_struct(a, 1, b, 2): struct<a: int, b: int>] Calcite: SELECT named_struct('a', 1, 'b", 2); type: row(a int not null, b int not null)
It's also possible to be nested:
spark.sql("""select named_struct("a", 1, "b", named_struct("c", 2))""") res5: org.apache.spark.sql.DataFrame = [named_struct(a, 1, b, named_struct(c, 2)): struct<a: int, b: struct<c: int>>]
Calcite: SELECT named_struct('a', 1, 'b', named_struct('c', 2)); type: row(a int not null, b row(c int not null) not null)
Attachments
Issue Links
- is related to
-
CALCITE-4842 Nested row type fails with unsupported type Record2_2
- Closed
-
CALCITE-2251 Support AS STRUCT syntax to create named STRUCT in SQL similar to Google BigQuery
- Open
-
CALCITE-4354 Allow ITEM operator on ROW/STRUCT data types
- Closed
-
CALCITE-4436 Use the fields order from the struct type for 'ITEM(STRUCT, INDEX)' access
- Closed
- links to
(1 links to)