cloud-fan commented on a change in pull request #34575:
URL: https://github.com/apache/spark/pull/34575#discussion_r755167684
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FileFormat.scala
##########
@@ -171,6 +171,28 @@ trait FileFormat {
def supportFieldName(name: String): Boolean = true
}
+object FileFormat {
+
+ val FILE_PATH = "file_path"
+
+ val FILE_NAME = "file_name"
+
+ val FILE_SIZE = "file_size"
+
+ val FILE_MODIFICATION_TIME = "file_modification_time"
+
+ val METADATA_NAME = "_metadata"
+
+ val METADATA_STRUCT: DataType = new StructType()
+ .add(StructField(FILE_PATH, StringType))
+ .add(StructField(FILE_NAME, StringType))
+ .add(StructField(FILE_SIZE, LongType))
+ .add(StructField(FILE_MODIFICATION_TIME, LongType))
+
+ // supported metadata columns for hadoop fs relation
+ def FILE_METADATA_COLUMNS: AttributeReference =
MetadataAttribute(METADATA_NAME, METADATA_STRUCT)
Review comment:
since it's a `def` now, how about `def createFileMetadataCol`
--
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]