pan3793 commented on code in PR #2635:
URL: https://github.com/apache/incubator-kyuubi/pull/2635#discussion_r877041470


##########
extensions/spark/kyuubi-spark-connector-tpcds/src/main/scala/org/apache/kyuubi/spark/connector/tpcds/TPCDSTable.scala:
##########
@@ -59,11 +59,18 @@ class TPCDSTable(tbl: String, scale: Int, options: 
CaseInsensitiveStringMap)
   override def name: String = s"`sf$scale`.`$tbl`"
 
   override def schema: StructType = {
-    // TODO tpcdsTable.notNullBitMap does not correct, set nullable follows
-    //      
https://tpc.org/TPC_Documents_Current_Versions/pdf/TPC-DS_v3.2.0.pdf
+    def nullable(index: Int): Boolean = {
+      val bitMask = 1L << index
+      (bitMask & ~tpcdsTable.getNotNullBitMap) != 0
+    }
     StructType(
       tpcdsTable.getColumns.zipWithIndex.map { case (c, i) =>
-        StructField(reviseColumnName(c), toSparkDataType(c.getType))
+        // Because the order of `GeneratorColumn` and `Column` of some tables 
is inconsistent,
+        // we need to revise the index of null column, in order to be 
consistent
+        //   with the calculation of null column in the getValues method of 
Row.

Review Comment:
   nit: spaces



-- 
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