yma11 commented on code in PR #3870:
URL: https://github.com/apache/incubator-gluten/pull/3870#discussion_r1521135199
##########
shims/spark34/src/main/scala/io/glutenproject/sql/shims/spark34/Spark34Shims.scala:
##########
@@ -153,6 +157,34 @@ class Spark34Shims extends SparkShims {
}
}
+ override def generateMetadataColumns(
+ file: PartitionedFile,
+ metadataColumnNames: Seq[String]): JMap[String, String] = {
+ val metadataColumn = new JHashMap[String, String]()
+ val path = new Path(file.filePath.toString)
+ for (columnName <- metadataColumnNames) {
+ columnName match {
+ case FileFormat.FILE_PATH => metadataColumn.put(FileFormat.FILE_PATH,
path.toString)
+ case FileFormat.FILE_NAME => metadataColumn.put(FileFormat.FILE_NAME,
path.getName)
+ case FileFormat.FILE_SIZE =>
+ metadataColumn.put(FileFormat.FILE_SIZE, file.fileSize.toString)
+ case FileFormat.FILE_MODIFICATION_TIME =>
+ val fileModifyTime = TimestampFormatter
+ .getFractionFormatter(ZoneOffset.UTC)
+ .format(file.modificationTime * 1000L)
+ metadataColumn.put(FileFormat.FILE_MODIFICATION_TIME, fileModifyTime)
+ case FileFormat.FILE_BLOCK_START =>
+ metadataColumn.put(FileFormat.FILE_BLOCK_START, file.start.toString)
+ case FileFormat.FILE_BLOCK_LENGTH =>
+ metadataColumn.put(FileFormat.FILE_BLOCK_LENGTH,
file.length.toString)
+ case _ =>
+ }
+ }
+
+ // TODO row_index metadata support
Review Comment:
`TODO: `
--
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]