Skip to content

Commit

Permalink
fix(isthmus): convert BinaryLiteral to VARBINARY
Browse files Browse the repository at this point in the history
BREAKING CHANGE: BinaryLiteral is no longer converted to BINARY<length>)
  • Loading branch information
vbarua committed Sep 20, 2023
1 parent b5ee4e0 commit 55cd81d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ public RexNode visit(Expression.FixedBinaryLiteral expr) throws RuntimeException

@Override
public RexNode visit(Expression.BinaryLiteral expr) throws RuntimeException {
// Calcite RexLiteral only takes ByteString
return rexBuilder.makeLiteral(
new ByteString(expr.value().toByteArray()),
typeConverter.toCalcite(typeFactory, expr.getType()));
typeConverter.toCalcite(typeFactory, expr.getType()),
true);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,8 @@ void tStr() {

@Test
void tBinary() {
// TODO: varbinary vs fixed length binary
var val = "my test".getBytes(StandardCharsets.UTF_8);
test(
bitest(
binary(false, val),
c(new org.apache.calcite.avatica.util.ByteString(val), SqlTypeName.VARBINARY));
}
Expand Down

0 comments on commit 55cd81d

Please sign in to comment.