cloud-fan commented on code in PR #53846:
URL: https://github.com/apache/spark/pull/53846#discussion_r2705479665
##########
sql/core/src/test/scala/org/apache/spark/sql/connector/MetadataColumnSuite.scala:
##########
@@ -356,4 +357,23 @@ class MetadataColumnSuite extends DatasourceV2SQLBase {
assert(cols.head.metadataInJSON() == null)
}
}
+
+ test("SPARK-49110: Project a metadata column while reading a padded char
column") {
+ withSQLConf(SQLConf.READ_SIDE_CHAR_PADDING.key -> "true") {
+ withTable(tbl) {
+ sql(s"CREATE TABLE $tbl (id bigint, data char(1)) PARTITIONED BY
(bucket(4, id), id)")
+ sql(s"INSERT INTO $tbl VALUES (1, 'a'), (2, 'b'), (3, 'c')")
+ val sqlQuery = sql(s"SELECT id, data, index, _partition FROM $tbl")
+ val sqlQueryWithAlias = sql(s"SELECT t.id, t.data, t.index,
t._partition FROM $tbl t")
Review Comment:
user specified subquery alias always work, can we test `SELECT $tbl.id, ...
FROM $tbl`?
--
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]