未验证 提交 6a555b2f 编写于 作者: A Alex Pelagenko 提交者: GitHub

fix(griffin): fix join metadata after making it case insensitive (#810)

上级 02f33951
......@@ -141,7 +141,7 @@ public class JoinRecordMetadata extends BaseRecordMetadata implements Closeable
final int dot = Chars.indexOf(columnName, lo, '.');
if (dot == -1) {
key.putStrLowerCase(null);
key.putStr(columnName, lo, hi);
key.putStrLowerCase(columnName, lo, hi);
} else {
key.putStrLowerCase(columnName, 0, dot);
key.putStrLowerCase(columnName, dot + 1, columnName.length());
......
......@@ -3552,6 +3552,35 @@ public class JoinTest extends AbstractGriffinTest {
});
}
@Test
public void testAsofJoin() throws Exception {
assertMemoryLeak(() -> {
compiler.compile("create table trips as (" +
" select rnd_double() fare_amount, " +
" CAST(x as Timestamp) pickup_datetime " +
" from long_sequence(5)) " +
"timestamp(pickup_datetime)", sqlExecutionContext);
compiler.compile("create table weather as (" +
" select rnd_double() tempF, " +
" rnd_int() windDir, " +
" cast(x as TIMESTAMP) timestamp " +
" from long_sequence(5)) " +
"timestamp(timestamp)", sqlExecutionContext);
assertQuery("pickup_datetime\tfare_amount\ttempF\twindDir\n" +
"1970-01-01T00:00:00.000001Z\t0.6607777894187332\t0.6508594025855301\t-1436881714\n" +
"1970-01-01T00:00:00.000002Z\t0.2246301342497259\t0.7905675319675964\t1545253512\n" +
"1970-01-01T00:00:00.000003Z\t0.08486964232560668\t0.22452340856088226\t-409854405\n" +
"1970-01-01T00:00:00.000004Z\t0.299199045961845\t0.3491070363730514\t1904508147\n" +
"1970-01-01T00:00:00.000005Z\t0.20447441837877756\t0.7611029514995744\t1125579207\n",
"SELECT pickup_datetime, fare_amount, tempF, windDir \n" +
"FROM (trips WHERE pickup_datetime = '1970-01-01') \n" +
"ASOF JOIN weather",
"pickup_datetime", false, false, true);
});
}
@Test
public void testTypeMismatchFF() throws Exception {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册