Skip to content

Commit

Permalink
add nested column
Browse files Browse the repository at this point in the history
  • Loading branch information
imback82 committed Feb 20, 2024
1 parent 3075c68 commit 617915b
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,9 @@ trait DescribeTableSuiteBase extends QueryTest with DDLCommandTestUtils {

test("describe a clustered table") {
withNamespaceAndTable("ns", "tbl") { tbl =>
sql(s"CREATE TABLE $tbl (col1 STRING COMMENT 'this is comment', col2 INT) " +
s"$defaultUsing CLUSTER BY (col1, col2)")
sql(s"CREATE TABLE $tbl (col1 STRING COMMENT 'this is comment', col2 struct<x:int, y:int>) " +
s"$defaultUsing CLUSTER BY (col1, col2.x)")
val descriptionDf = sql(s"DESC $tbl")
descriptionDf.show(false)
assert(descriptionDf.schema.map(field => (field.name, field.dataType)) === Seq(
("col_name", StringType),
("data_type", StringType),
Expand All @@ -193,11 +192,11 @@ trait DescribeTableSuiteBase extends QueryTest with DDLCommandTestUtils {
descriptionDf,
Seq(
Row("col1", "string", "this is comment"),
Row("col2", "int", null),
Row("col2", "struct<x:int,y:int>", null),
Row("# Clustering Information", "", ""),
Row("# col_name", "data_type", "comment"),
Row("col1", "string", "this is comment"),
Row("col2", "int", null)))
Row("col2.x", "int", null)))
}
}
}

0 comments on commit 617915b

Please sign in to comment.