use of com.questdb.ql.join.AsOfJoinRecordSource in project questdb by bluestreak01.
the class AsOfPartitionedJoinRecordSourceTest method testFixNonPartitionedJoin.
@Test
public void testFixNonPartitionedJoin() throws Exception {
final String expected = "2015-03-10T00:01:00.000Z\tSWHYRX\t9.986581325531\tDHM\t2015-03-10T00:00:50.000Z\tPEHNRX\t0.299514681101\t768.000000000000\tSWHYRX\t-5710210982977201267\t0.0955\t-29572\ttrue\n" + "2015-03-10T00:02:00.000Z\tVTJWCP\t0.000000022642\tHBEKCGJOZWRXKMTFXRYPHFPUYWNLBVVHN\t2015-03-10T00:01:50.000Z\tSWHYRX\t0.000036501544\t0.000000036384\tVTJWCP\t8810110521992874823\t0.5159\t28877\tfalse\n" + "2015-03-10T00:03:00.000Z\tVTJWCP\t0.000000012344\tRTLXHBHDHIMFYOJREFUTMSGUYXLXWLUKSXSCMGFCDFGVDKHCZIUISSCBVCLYMFERSXQCHTKLTNYILMDTHTXDEHNVMEVIJQRJMLJKFYHZXH\t2015-03-10T00:02:50.000Z\tVTJWCP\t-353.683593750000\t0.000000000000\tPEHNRX\t6436453824498875972\t0.4737\t21824\tfalse\n" + "2015-03-10T00:04:00.000Z\tPEHNRX\t0.000000006259\tGOVGNCFYDU\t2015-03-10T00:03:50.000Z\tPEHNRX\t25.839271545410\t0.360216885805\tPEHNRX\t-3290351886406648039\t0.3296\t27881\tfalse\n" + "2015-03-10T00:05:00.000Z\tSWHYRX\t-1024.000000000000\tZJBFLWWXEBZTZYTHPWGBNPIIFNYPCBTIOJYWUIYFQPXWVETMPCONIJMVFQFDBOMQBLBVQHLSYJUEGYZYOOMNSZVWS\t2015-03-10T00:04:50.000Z\tPEHNRX\t70.810325622559\t0.000005221712\tSWHYRX\t6904166490726350488\t0.3863\t11305\tfalse\n" + "2015-03-10T00:06:00.000Z\tVTJWCP\t800.000000000000\tEBNYHKWBXMYTZSUXQSWVRVUOSTZQBMERYZ\t2015-03-10T00:05:50.000Z\tVTJWCP\t12.456869840622\t55.575583457947\tPEHNRX\t-8698821645604291033\t0.4353\t2237\tfalse\n" + "2015-03-10T00:07:00.000Z\tPEHNRX\t0.000000057413\t\t2015-03-10T00:06:50.000Z\tVTJWCP\t-384.000000000000\t19.552153110504\tVTJWCP\t-3269323743905958237\t0.6822\t11402\ttrue\n" + "2015-03-10T00:08:00.000Z\tSWHYRX\t0.897577673197\t\t2015-03-10T00:07:50.000Z\tPEHNRX\t272.870239257813\t-128.000000000000\tPEHNRX\t-5016390518489182614\t0.6254\t-8459\tfalse\n" + "2015-03-10T00:09:00.000Z\tPEHNRX\t797.375000000000\tKXQHOKXHXYWTYFMYVYBVUBHMYQRVVMKMIPOVRTZDGOG\t2015-03-10T00:08:50.000Z\tVTJWCP\t0.004611001699\t0.000000023394\tVTJWCP\t8649805687735202371\t0.7444\t-20513\ttrue\n" + "2015-03-10T00:10:00.000Z\tVTJWCP\t0.000456069203\t\t2015-03-10T00:09:50.000Z\tSWHYRX\t552.831069946289\t0.013248343952\tPEHNRX\t-9141139959474635253\t0.5255\t19898\ttrue\n";
long memUsed = Unsafe.getMemUsed();
try (AsOfJoinRecordSource source = new AsOfJoinRecordSource(compileSource("y"), 0, new NoRowIdRecordSource().of(compileSource("select timestamp, ccy, rate, amount, contra, ln, fl, sh, b from x")), 0)) {
assertThat(expected, source);
}
Assert.assertEquals(memUsed, Unsafe.getMemUsed());
}
use of com.questdb.ql.join.AsOfJoinRecordSource in project questdb by bluestreak01.
the class AsOfPartitionedJoinRecordSourceTest method testVarNonPartitioned.
@Test
public void testVarNonPartitioned() throws Exception {
try (AsOfJoinRecordSource source = new AsOfJoinRecordSource(compileSource("y"), 0, new NoRowIdRecordSource().of(compileSource("x")), 0)) {
String expected = "2015-03-10T00:01:00.000Z\tSWHYRX\t9.986581325531\tDHM\t2015-03-10T00:00:50.000Z\tPEHNRX\t0.299514681101\t768.000000000000\t\tSWHYRX\t0.0955\t-29572\t-5710210982977201267\ttrue\n" + "2015-03-10T00:02:00.000Z\tVTJWCP\t0.000000022642\tHBEKCGJOZWRXKMTFXRYPHFPUYWNLBVVHN\t2015-03-10T00:01:50.000Z\tSWHYRX\t0.000036501544\t0.000000036384\tHFVWSWSRGOO\tVTJWCP\t0.5159\t28877\t8810110521992874823\tfalse\n" + "2015-03-10T00:03:00.000Z\tVTJWCP\t0.000000012344\tRTLXHBHDHIMFYOJREFUTMSGUYXLXWLUKSXSCMGFCDFGVDKHCZIUISSCBVCLYMFERSXQCHTKLTNYILMDTHTXDEHNVMEVIJQRJMLJKFYHZXH\t2015-03-10T00:02:50.000Z\tVTJWCP\t-353.683593750000\t0.000000000000\t\tPEHNRX\t0.4737\t21824\t6436453824498875972\tfalse\n" + "2015-03-10T00:04:00.000Z\tPEHNRX\t0.000000006259\tGOVGNCFYDU\t2015-03-10T00:03:50.000Z\tPEHNRX\t25.839271545410\t0.360216885805\tZKYFLUHZQSNPXMKJSMKIXEYVTUPDHHGGIWHPZRHHMGZJYYFLSVIHDWWLEVMLKCJBEVLUHLIHYBTVZNCLN\tPEHNRX\t0.3296\t27881\t-3290351886406648039\tfalse\n" + "2015-03-10T00:05:00.000Z\tSWHYRX\t-1024.000000000000\tZJBFLWWXEBZTZYTHPWGBNPIIFNYPCBTIOJYWUIYFQPXWVETMPCONIJMVFQFDBOMQBLBVQHLSYJUEGYZYOOMNSZVWS\t2015-03-10T00:04:50.000Z\tPEHNRX\t70.810325622559\t0.000005221712\tXCDKDWOMDXCBJFRPXZSFXUNYQXTGNJJILLEYMIWTCWLFORGFIEVMKPYVGPYKKBMQMUDDCIHCNPUGJOPJEUKWMDNZZBBUKOJSOLDYRODIPUNRPSMIFDYPDK\tSWHYRX\t0.3863\t11305\t6904166490726350488\tfalse\n" + "2015-03-10T00:06:00.000Z\tVTJWCP\t800.000000000000\tEBNYHKWBXMYTZSUXQSWVRVUOSTZQBMERYZ\t2015-03-10T00:05:50.000Z\tVTJWCP\t12.456869840622\t55.575583457947\tDILELRUMMZSCJOUOUIGENFELWWRSLBMQHGJBFQBBKFIJZZYNPPB\tPEHNRX\t0.4353\t2237\t-8698821645604291033\tfalse\n" + "2015-03-10T00:07:00.000Z\tPEHNRX\t0.000000057413\t\t2015-03-10T00:06:50.000Z\tVTJWCP\t-384.000000000000\t19.552153110504\tRHGKRKKUSIMYDXUUSKCXNMUREIJUHCLQCMZCCYVBDMQEHDHQHKSNGIZRPFM\tVTJWCP\t0.6822\t11402\t-3269323743905958237\ttrue\n" + "2015-03-10T00:08:00.000Z\tSWHYRX\t0.897577673197\t\t2015-03-10T00:07:50.000Z\tPEHNRX\t272.870239257813\t-128.000000000000\t\tPEHNRX\t0.6254\t-8459\t-5016390518489182614\tfalse\n" + "2015-03-10T00:09:00.000Z\tPEHNRX\t797.375000000000\tKXQHOKXHXYWTYFMYVYBVUBHMYQRVVMKMIPOVRTZDGOG\t2015-03-10T00:08:50.000Z\tVTJWCP\t0.004611001699\t0.000000023394\tUMKUBKXPMSXQSTVSTYSWHLSWPFHXDBXPNKGQELQDWQGMZBPHETSLOIMSUFXYIWE\tVTJWCP\t0.7444\t-20513\t8649805687735202371\ttrue\n" + "2015-03-10T00:10:00.000Z\tVTJWCP\t0.000456069203\t\t2015-03-10T00:09:50.000Z\tSWHYRX\t552.831069946289\t0.013248343952\t\tPEHNRX\t0.5255\t19898\t-9141139959474635253\ttrue\n";
printer.print(source, FACTORY_CONTAINER.getFactory());
TestUtils.assertEquals(expected, sink);
}
}
use of com.questdb.ql.join.AsOfJoinRecordSource in project questdb by bluestreak01.
the class AsOfPartitionedJoinRecordSourceTest method testRowidNonPartitioned.
@Test
public void testRowidNonPartitioned() throws Exception {
AsOfJoinRecordSource source = new AsOfJoinRecordSource(compileSource("y"), 0, compileSource("x"), 0);
String expected = "2015-03-10T00:01:00.000Z\tSWHYRX\t9.986581325531\tDHM\t2015-03-10T00:00:50.000Z\tPEHNRX\t0.299514681101\t768.000000000000\t\tSWHYRX\t0.0955\t-29572\t-5710210982977201267\ttrue\n" + "2015-03-10T00:02:00.000Z\tVTJWCP\t0.000000022642\tHBEKCGJOZWRXKMTFXRYPHFPUYWNLBVVHN\t2015-03-10T00:01:50.000Z\tSWHYRX\t0.000036501544\t0.000000036384\tHFVWSWSRGOO\tVTJWCP\t0.5159\t28877\t8810110521992874823\tfalse\n" + "2015-03-10T00:03:00.000Z\tVTJWCP\t0.000000012344\tRTLXHBHDHIMFYOJREFUTMSGUYXLXWLUKSXSCMGFCDFGVDKHCZIUISSCBVCLYMFERSXQCHTKLTNYILMDTHTXDEHNVMEVIJQRJMLJKFYHZXH\t2015-03-10T00:02:50.000Z\tVTJWCP\t-353.683593750000\t0.000000000000\t\tPEHNRX\t0.4737\t21824\t6436453824498875972\tfalse\n" + "2015-03-10T00:04:00.000Z\tPEHNRX\t0.000000006259\tGOVGNCFYDU\t2015-03-10T00:03:50.000Z\tPEHNRX\t25.839271545410\t0.360216885805\tZKYFLUHZQSNPXMKJSMKIXEYVTUPDHHGGIWHPZRHHMGZJYYFLSVIHDWWLEVMLKCJBEVLUHLIHYBTVZNCLN\tPEHNRX\t0.3296\t27881\t-3290351886406648039\tfalse\n" + "2015-03-10T00:05:00.000Z\tSWHYRX\t-1024.000000000000\tZJBFLWWXEBZTZYTHPWGBNPIIFNYPCBTIOJYWUIYFQPXWVETMPCONIJMVFQFDBOMQBLBVQHLSYJUEGYZYOOMNSZVWS\t2015-03-10T00:04:50.000Z\tPEHNRX\t70.810325622559\t0.000005221712\tXCDKDWOMDXCBJFRPXZSFXUNYQXTGNJJILLEYMIWTCWLFORGFIEVMKPYVGPYKKBMQMUDDCIHCNPUGJOPJEUKWMDNZZBBUKOJSOLDYRODIPUNRPSMIFDYPDK\tSWHYRX\t0.3863\t11305\t6904166490726350488\tfalse\n" + "2015-03-10T00:06:00.000Z\tVTJWCP\t800.000000000000\tEBNYHKWBXMYTZSUXQSWVRVUOSTZQBMERYZ\t2015-03-10T00:05:50.000Z\tVTJWCP\t12.456869840622\t55.575583457947\tDILELRUMMZSCJOUOUIGENFELWWRSLBMQHGJBFQBBKFIJZZYNPPB\tPEHNRX\t0.4353\t2237\t-8698821645604291033\tfalse\n" + "2015-03-10T00:07:00.000Z\tPEHNRX\t0.000000057413\t\t2015-03-10T00:06:50.000Z\tVTJWCP\t-384.000000000000\t19.552153110504\tRHGKRKKUSIMYDXUUSKCXNMUREIJUHCLQCMZCCYVBDMQEHDHQHKSNGIZRPFM\tVTJWCP\t0.6822\t11402\t-3269323743905958237\ttrue\n" + "2015-03-10T00:08:00.000Z\tSWHYRX\t0.897577673197\t\t2015-03-10T00:07:50.000Z\tPEHNRX\t272.870239257813\t-128.000000000000\t\tPEHNRX\t0.6254\t-8459\t-5016390518489182614\tfalse\n" + "2015-03-10T00:09:00.000Z\tPEHNRX\t797.375000000000\tKXQHOKXHXYWTYFMYVYBVUBHMYQRVVMKMIPOVRTZDGOG\t2015-03-10T00:08:50.000Z\tVTJWCP\t0.004611001699\t0.000000023394\tUMKUBKXPMSXQSTVSTYSWHLSWPFHXDBXPNKGQELQDWQGMZBPHETSLOIMSUFXYIWE\tVTJWCP\t0.7444\t-20513\t8649805687735202371\ttrue\n" + "2015-03-10T00:10:00.000Z\tVTJWCP\t0.000456069203\t\t2015-03-10T00:09:50.000Z\tSWHYRX\t552.831069946289\t0.013248343952\t\tPEHNRX\t0.5255\t19898\t-9141139959474635253\ttrue\n";
assertThat(expected, source);
}
Aggregations