Skip to content

Commit

Permalink
Add test cases for getbit
Browse files Browse the repository at this point in the history
  • Loading branch information
herunkang2018 committed Jul 15, 2023
1 parent 682ad9b commit b414f89
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3951,7 +3951,8 @@ static void checkRlikeFails(SqlOperatorFixture f) {
final SqlOperatorFixture f0 = fixture();
f0.setFor(SqlLibraryOperators.BIT_GET, VmName.EXPAND);
f0.checkFails("^BIT_GET(cast(11 as bigint), 1)^",
"No match found for function signature BIT_GET\\(<NUMERIC>, <NUMERIC>\\)", false);
"No match found for function signature BIT_GET\\(<NUMERIC>, <NUMERIC>\\)",
false);

final SqlOperatorFixture f1 = f0.withLibrary(SqlLibrary.SPARK);
// test for bigint value
Expand Down Expand Up @@ -3985,6 +3986,17 @@ static void checkRlikeFails(SqlOperatorFixture f) {
true);
}

@Test void testGetBitFunc() {
final SqlOperatorFixture f0 = fixture();
f0.setFor(SqlLibraryOperators.GETBIT, VmName.EXPAND);
f0.checkFails("^GETBIT(cast(11 as bigint), 1)^",
"No match found for function signature GETBIT\\(<NUMERIC>, <NUMERIC>\\)",
false);

final SqlOperatorFixture f1 = f0.withLibrary(SqlLibrary.SPARK);
f1.checkScalarExact("GETBIT(cast(11 as bigint), 3)", 1);
}

@Test void testAsciiFunc() {
final SqlOperatorFixture f = fixture();
f.setFor(SqlStdOperatorTable.ASCII, VmName.EXPAND);
Expand Down

0 comments on commit b414f89

Please sign in to comment.