Search in sources :

Example 1 with NoRowIdRecordSource

use of com.questdb.ql.NoRowIdRecordSource in project questdb by bluestreak01.

the class JoinQueryTest method testJoinNoRowid.

@Test
public void testJoinNoRowid() throws Exception {
    final String expected = "100\tPJFSREKEUNMKWOF\tUVKWCCVTJSKMXVEGPIG\t\tVMY\tRT\tEYYPDVRGRQG\t2015-07-10T00:00:00.100Z\t104281903\t100\t1138\tKWK\t2015-07-10T00:00:14.518Z\tFBLGGTZEN\n" + "100\tPJFSREKEUNMKWOF\tUVKWCCVTJSKMXVEGPIG\t\tVMY\tRT\tEYYPDVRGRQG\t2015-07-10T00:00:00.100Z\t1191623531\t100\t1210\tSR\t2015-07-10T00:00:18.175Z\tYM\n" + "100\tPJFSREKEUNMKWOF\tUVKWCCVTJSKMXVEGPIG\t\tVMY\tRT\tEYYPDVRGRQG\t2015-07-10T00:00:00.100Z\t1662742408\t100\t1828\tQH\t2015-07-10T00:00:19.509Z\tEYBI\n" + "100\tPJFSREKEUNMKWOF\tUVKWCCVTJSKMXVEGPIG\t\tVMY\tRT\tEYYPDVRGRQG\t2015-07-10T00:00:00.100Z\t220389\t100\t1293\tDGEEWB\t2015-07-10T00:00:56.196Z\tEYBI\n" + "100\tPJFSREKEUNMKWOF\tUVKWCCVTJSKMXVEGPIG\t\tVMY\tRT\tEYYPDVRGRQG\t2015-07-10T00:00:00.100Z\t798408721\t100\t803\tZIHLGS\t2015-07-10T00:00:56.977Z\tVTNNKVOLHLLNN\n" + "100\tPJFSREKEUNMKWOF\tUVKWCCVTJSKMXVEGPIG\t\tVMY\tRT\tEYYPDVRGRQG\t2015-07-10T00:00:00.100Z\t966974434\t100\t870\tJEOBQ\t2015-07-10T00:00:57.981Z\tW\n" + "100\tPJFSREKEUNMKWOF\tUVKWCCVTJSKMXVEGPIG\t\tVMY\tRT\tEYYPDVRGRQG\t2015-07-10T00:00:00.100Z\t258318715\t100\t1036\tOPWOGS\t2015-07-10T00:01:00.608Z\tEYBI\n" + "100\tPJFSREKEUNMKWOF\tUVKWCCVTJSKMXVEGPIG\t\tVMY\tRT\tEYYPDVRGRQG\t2015-07-10T00:00:00.100Z\t1528068156\t100\t400\tYBQE\t2015-07-10T00:01:20.643Z\tQXOLEEXZ\n" + "100\tPJFSREKEUNMKWOF\tUVKWCCVTJSKMXVEGPIG\t\tVMY\tRT\tEYYPDVRGRQG\t2015-07-10T00:00:00.100Z\t1935884354\t100\t1503\tD\t2015-07-10T00:01:43.507Z\tRZVZJQRNYSRKZSJ\n";
    final RecordSource m = compileSource("customers where customerName ~ 'PJFSREKEUNMKWOF'");
    final RecordSource s = new NoRowIdRecordSource().of(compileSource("orders"));
    RecordSource r = new HashJoinRecordSource(m, new IntList() {

        {
            add(m.getMetadata().getColumnIndex("customerId"));
        }
    }, s, new IntList() {

        {
            add(s.getMetadata().getColumnIndex("customerId"));
        }
    }, false, 4 * 1024 * 1024, 4 * 1024 * 1024, 1024 * 1024, new RecordKeyCopierCompiler(new BytecodeAssembler()));
    sink.clear();
    printer.print(r, FACTORY_CONTAINER.getFactory());
    TestUtils.assertEquals(expected, sink);
    assertThat(expected, "customers c join orders o on c.customerId = o.customerId where customerName ~ 'PJFSREKEUNMKWOF'");
}
Also used : NoRowIdRecordSource(com.questdb.ql.NoRowIdRecordSource) HashJoinRecordSource(com.questdb.ql.join.HashJoinRecordSource) RecordSource(com.questdb.ql.RecordSource) RecordKeyCopierCompiler(com.questdb.ql.map.RecordKeyCopierCompiler) HashJoinRecordSource(com.questdb.ql.join.HashJoinRecordSource) NoRowIdRecordSource(com.questdb.ql.NoRowIdRecordSource) Test(org.junit.Test)

Aggregations

NoRowIdRecordSource (com.questdb.ql.NoRowIdRecordSource)1 RecordSource (com.questdb.ql.RecordSource)1 HashJoinRecordSource (com.questdb.ql.join.HashJoinRecordSource)1 RecordKeyCopierCompiler (com.questdb.ql.map.RecordKeyCopierCompiler)1 Test (org.junit.Test)1