jubins commented on PR #56582: URL: https://github.com/apache/spark/pull/56582#issuecomment-4744621673
> LGTM overall — the fix is a faithful port of the [SPARK-52234](https://issues.apache.org/jira/browse/SPARK-52234) change already in `schema_of_csv` / `schema_of_xml` (the condition chain is character-identical to both siblings, removing the unsafe `asInstanceOf[UTF8String]` cast), and the added `schema_of_json(42)` test mirrors the csv/xml suites. > > One thing to fix before merge: the golden files need to be regenerated. CI (`sql - extended tests`) fails on `select schema_of_json(42)` because the hardcoded `queryContext` offset is off by one — the files have `"stopIndex" : 24`, but the analyzer emits `25` (the closing `)` of `schema_of_json(42)` is at column 25, and the `fragment` string already spans 8→25, so `24` is internally inconsistent). This is the usual symptom of hand-editing a golden file instead of regenerating it. > > Please regenerate rather than hand-editing: > > ``` > SPARK_GENERATE_GOLDEN_FILES=1 build/sbt "sql/testOnly org.apache.spark.sql.SQLQueryTestSuite -- -z json-functions.sql" > ``` > > Then double-check the diff — only the two `stopIndex` values (24 → 25) in `results/json-functions.sql.out` and `analyzer-results/json-functions.sql.out` should change. Thanks for the review! Fixed, updated stopIndex from 24 to 25 in both results/json-functions.sql.out and analyzer-results/json-functions.sql.out. That was the only diff. -- 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]
