Github user ueshin commented on a diff in the pull request:
https://github.com/apache/spark/pull/16133#discussion_r90774307
--- Diff:
sql/core/src/test/scala/org/apache/spark/sql/ColumnExpressionSuite.scala ---
@@ -533,31 +533,54 @@ class ColumnExpressionSuite extends QueryTest with
SharedSQLContext {
)
}
- test("input_file_name - FileScanRDD") {
+ test("input_file_name, input_file_block_start, input_file_block_length -
FileScanRDD") {
withTempPath { dir =>
val data = sparkContext.parallelize(0 to 10).toDF("id")
data.write.parquet(dir.getCanonicalPath)
- val answer =
spark.read.parquet(dir.getCanonicalPath).select(input_file_name())
- .head.getString(0)
- assert(answer.contains(dir.getCanonicalPath))
- checkAnswer(data.select(input_file_name()).limit(1), Row(""))
+ // Test the 3 expressions when reading from files
+ val q = spark.read.parquet(dir.getCanonicalPath).select(
+ input_file_name(), expr("input_file_block_start()"),
expr("input_file_block_length()"))
--- End diff --
We should add `input_file_block_start()`, `input_file_block_length()` to
`functions.scala` and use them the same as `input_file_name()`?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]