Skip to content

fix: include column headers in offline SQL results - #13

Merged
dingxin-tech merged 1 commit into
mainfrom
fix/sql-result-csv-header
Oct 5, 2026
Merged

dingxin-tech merged 1 commit into
mainfrom
fix/sql-result-csv-header

Conversation

@dingxin-tech

@dingxin-tech dingxin-tech commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

SQLTask.getResult treated the first data row of an offline SQL result as its CSV header. A three-row no-primary-key batch upload therefore appeared to return two rows, even though table download still reported three.

Emit the result's column names before its rows. This keeps the existing CSV escaping, LF line endings and \N null marker, leaves SQLRT/tunnel output unchanged, and retains schema for empty SELECTs without adding output to non-query statements.

Fixes #12.

Validation:

  • New HTTP regressions fail against the original image for three-row and empty SELECT results, and pass with the fix. Coverage also exercises comma/quote/newline column names and values, null, empty string, XML escaping and non-query output.
  • Docker go test -race ./... and go vet -unreachable=false ./...: passed.
  • Java SDK 0.51.2-public via Testcontainers: 3 tests passed, including createUploadSession -> openBufferedWriter -> close -> commit -> SQLTask.getResult with all three rows and values. A legacy Maven profile and CI step preserve this regression alongside the default SDK suite.
  • Docker C++ Arrow/CRC contract and fault probes: passed.
  • Existing modern Java SDK 0.61.2-public acceptance: 48 tests passed, including SQLRT/session, typed tunnel, storage, resources and UDF metadata. Official JDBC driver 3.10.13 acceptance: 3 tests passed. GitHub acceptance runs the full consumer gate.

SeaTunnel's E2E remains not run due to its separate 65-module build environment requirement. This PR does not re-enable its disabled test or update its emulator image. No real cloud services were used.

GitHub acceptance run 37215698073 passed on ff7bd72772cd8c580487e5fee139f8c461896e02, including modern and legacy SDKs, JDBC, PyODPS and C++ probes.

@dingxin-tech
dingxin-tech marked this pull request as ready for review October 5, 2026 02:04
@dingxin-tech
dingxin-tech merged commit 0c9d708 into main Oct 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SQLTask.getResult drops first row because SQL instance CSV has no header

1 participant