feat(redshift): add the SUPER and VARBYTE types and their functions (#8571)

This commit is contained in:
Vũ Thế Huy authored and GitHub committed 2026-11-16 08:52:44 -04:00
1 parent f0ee5d44a0
commit 4f623d7b50
7 files changed
+526

No files matched your search

@@ -156,6 +156,25 @@ class RedshiftDataOperationsTest {
assertThat(result.records().get(0).get(1).stringValue()).isEqualTo("a");
}
@Test
@DisplayName("SUPER and VARBYTE columns round trip through JSON_PARSE, TO_VARBYTE and their readers")
void superAndVarbyteRoundTrip() throws Exception {
run("CREATE TABLE compat_super (id int, doc SUPER, raw VARBYTE(16))");
run("INSERT INTO compat_super VALUES (1, JSON_PARSE('[10001,10002,\"abc\"]'), TO_VARBYTE('6162', 'hex'))");
String selectId = run("SELECT JSON_SERIALIZE(doc), JSON_TYPEOF(doc), FROM_VARBYTE(raw, 'utf8'), "
+ "CAN_JSON_PARSE('This is a string.') FROM compat_super");
GetStatementResultResponse result = data.getStatementResult(GetStatementResultRequest.builder()
.id(selectId)
.build());
assertThat(result.records()).hasSize(1);
assertThat(result.records().get(0).get(0).stringValue()).isEqualTo("[10001,10002,\"abc\"]");
assertThat(result.records().get(0).get(1).stringValue()).isEqualTo("array");
assertThat(result.records().get(0).get(2).stringValue()).isEqualTo("ab");
assertThat(result.records().get(0).get(3).booleanValue()).isFalse();
}
@Test
@DisplayName("named SQL parameters are bound through the SDK model")
void parameterizedStatementBindsSqlParameters() throws Exception {