Repository navigation
fix(import-export): keep binary values, booleans, all-NULL rows and zoned times through copy, import and export - #4221
Merged
Merged
Conversation
datlechin
enabled auto-merge (squash)
November 12, 2026 05:27
# Conflicts: # apple/TablePro/Core/Services/Export/ImportService.swift # apple/TablePro/Core/Utilities/SQL/RowValueCopyFormatter.swift # apple/TablePro/Extensions/String+HexDump.swift # apple/TablePro/Resources/Localizable.xcstrings
# Conflicts: # apple/TablePro/Core/Plugins/ImportDataSinkAdapter.swift # apple/TableProTests/Core/Plugins/ImportDataSinkAdapterBitColumnTests.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
0xhex, not the first 64. Pasting0xhex into a binary column stages the bytes, in a cell or in pasted rows; a0xvalue that is not hex is refused. (IX-1)0xhex and JSON Base64 into bytes. Other text is written as text, as before, so PostgreSQL's own\xbytea JSON still imports; a0xvalue that is not hex fails its row. (IX-3)1and0(MySQL, MariaDB, SQL Server, SQLite, Oracle, ClickHouse and others), a boolean column takestrue,false,yes,no,on,off,t,f,y,nas1/0. A new SQLite table types a boolean fieldBOOLEAN(NUMERIC affinity) so it reads as one. (IX-5),,) as a row, and an empty line in a one-column file as a NULL. Empty records after the last value are still skipped: a spreadsheet saves its empty rows that way. A JSON{}row writes an all-defaults INSERT instead of being dropped and counted; an engine with no such INSERT fails the row and says why. (IX-2)0x, apart from NULL. (IX-6, IX-3)timestamp with time zone,timestamptz, Oraclewith local time zone(the driver writes its offset) andtimetzas TIMESTAMPTZ and TIMETZ, adjusted to UTC, instead of dropping the offset. Checked on the shipped DuckDB with the probe. (IX-4)1/0on numeric-boolean engines and binary values as the engine's binary literal instead of dropping them. (IX-7)Tests changed on purpose:
CSVImportPluginTests.testIsBlank:["", ""]is no longer blank.ExportImportRoundTripTestsFormatLimits.xlsx: zero bytes now round-trip as0x.XLSXWriterStreamingTests.workbookDigest: the fixture's zero-byte cell is now0x.ImportDataSinkAdapterBitColumnTests.anEngineThatReadsBitsAsDigitsIsNotAsked, nowanEngineThatReadsBitsAsDigitsGetsNoCast: a PostgreSQL row import reads the columns once.ImportDataSinkAdapterMappingTests.emptyRowIsNotAnError,emptyRowInBatchIsNotAnError: still no error; the empty row is now written as a row of defaults.Needs the maintainer:
'abcd'in a BLOB) is decoded. JSON has no binary type, and Base64 is what the export writes.Docs: TableProApp/docs#212
Test plan
ImportDataSinkAdapterTargetValueTests,ImportBinaryTextTests,XLSXSheetRowsTests,BlobFormattingServiceCopyTests, cases inInClauseConverterTests,DataGridPasteIntoSelectionTests,RowOperationsManagerPasteTests,CSVImportRowShapeTests,CSVImportPluginTests,ImportTypeMapperTests.verify.sh plugins,lintandl10npass.apple/scripts/probes/check-parquet-export-values.shpasses against the shippedlibduckdb.a(v2.0.0), with zoned timestamps, a zoned time and Oracle's local time zone added.