LOAD 'chdb_hook'; /****************************************************************************/ -- Variable length strings. CREATE TABLE varchars ( vc VARCHAR NOT NULL, vcn VARCHAR(8) NOT NULL, bc VARBIT NOT NULL, bcn VARBIT(4) NOT NULL ); INSERT INTO varchars VALUES ('', '', '', '') , (' ', ' ', '10100101', '1010') , ('hi there', 'hi you', '0', '0101') , ('๐Ÿ˜ƒ ๐Ÿจ ๐ŸŽฑ', 'ๆ˜ฏๆ— ๆ•ˆ็š„ๅ‘ฝไปค', '1', '1100') ; -- Execute round-trip to all supported formats. CREATE TABLE varchars2 (LIKE varchars INCLUDING ALL); \set from_table varchars \set to_table varchars2 \set output_file varchars.tmp \i test/utils/round-trip-formats.sql \set ECHO errors t: TabSeparated t: TabSeparatedRaw t: TabSeparatedWithNames t: TabSeparatedWithNamesAndTypes t: TabSeparatedRawWithNames t: TabSeparatedRawWithNamesAndTypes t: CSV t: CSVWithNames t: CSVWithNamesAndTypes t: CustomSeparated t: CustomSeparatedWithNames t: CustomSeparatedWithNamesAndTypes t: Values t: JSON t: JSONColumns t: JSONColumnsWithMetadata t: JSONCompact t: JSONCompactColumns t: JSONEachRow t: JSONStringsEachRow t: JSONCompactEachRow t: JSONCompactStringsEachRow t: JSONCompactEachRowWithNames t: JSONCompactEachRowWithNamesAndTypes t: JSONCompactStringsEachRowWithNames t: JSONCompactStringsEachRowWithNamesAndTypes t: JSONObjectEachRow t: TSKV t: Native t: RowBinary t: RowBinaryWithNames t: RowBinaryWithNamesAndTypes t: Parquet t: Arrow t: ArrowStream t: ORC t: Avro t: Protobuf t: ProtobufList t: MsgPack t: BSONEachRow /****************************************************************************/ -- Variable length string arrays. CREATE TABLE varchar_arrays ( vc VARCHAR[] NOT NULL, vcn VARCHAR(8)[] NOT NULL, bc VARBIT[] NOT NULL, bcn VARBIT(4)[] NOT NULL ); INSERT INTO varchar_arrays VALUES ('{}', '{}', '{}', '{}') , ('{ }', '{ }', '{10100101}', '{1010}') , ('{hi there, NULL}', '{NULL, hi you}', '{NULL, 0, 1}', '{0101, 0011}') , ('{๐Ÿ˜ƒ ๐Ÿจ ๐ŸŽฑ}', '{ๆ˜ฏๆ— ๆ•ˆ็š„ๅ‘ฝไปค}', '{1, NULL}', '{1100}') ; -- Execute round-trip to all supported formats. Protobuf has no null in a -- repeated field, so the arrays carrying one come back short. CREATE TABLE varchar_arrays2 (LIKE varchar_arrays INCLUDING ALL); \set from_table varchar_arrays \set to_table varchar_arrays2 \i test/utils/round-trip-formats.sql \set ECHO errors t: TabSeparated t: TabSeparatedRaw t: TabSeparatedWithNames t: TabSeparatedWithNamesAndTypes t: TabSeparatedRawWithNames t: TabSeparatedRawWithNamesAndTypes t: CSV t: CSVWithNames t: CSVWithNamesAndTypes t: CustomSeparated t: CustomSeparatedWithNames t: CustomSeparatedWithNamesAndTypes t: Values t: JSON t: JSONColumns t: JSONColumnsWithMetadata t: JSONCompact t: JSONCompactColumns t: JSONEachRow t: JSONStringsEachRow t: JSONCompactEachRow t: JSONCompactStringsEachRow t: JSONCompactEachRowWithNames t: JSONCompactEachRowWithNamesAndTypes t: JSONCompactStringsEachRowWithNames t: JSONCompactStringsEachRowWithNamesAndTypes t: JSONObjectEachRow t: TSKV t: Native t: RowBinary t: RowBinaryWithNames t: RowBinaryWithNamesAndTypes t: Parquet t: Arrow t: ArrowStream t: ORC t: Avro f: Protobuf f: ProtobufList t: MsgPack t: BSONEachRow \set ECHO errors