package edu.umich.verdict.redshift;

import edu.umich.verdict.VerdictConf;
import edu.umich.verdict.VerdictContext;
import edu.umich.verdict.VerdictJDBCContext;
import edu.umich.verdict.exceptions.VerdictException;

public class RedshiftThroughVerdictTest {

    public static void main(String[] args) throws VerdictException {

        VerdictConf conf = new VerdictConf();
        conf.setDbms("redshift");
        conf.setHost("salat2-verdict.ctkb4oe4rzfm.us-east-1.redshift.amazonaws.com");
        conf.setPort("5439");		
        conf.setDbmsSchema("dev");
        conf.setUser("junhao");
        conf.setPassword("BTzyc1xG");
        conf.set("loglevel", "debug");
        
        VerdictContext vc = VerdictJDBCContext.from(conf);
        
//        vc.executeJdbcQuery("set bypass=false");
        vc.executeJdbcQuery("set search_path = tpch1g,tpch1g_verdict");
//        vc.executeJdbcQuery("set bypass=false");
        
//        long startTime = System.currentTimeMillis();                
        vc.executeJdbcQuery("create sample of tpch1g.orders");        
//        long endTime   = System.currentTimeMillis();
//        long totalTime = endTime - startTime;
//        System.out.println(totalTime);
//
//        vc.executeJdbcQuery("create stratified sample of tpch1g.lineitem on l_suppkey");
//
//        vc.executeJdbcQuery("create universe sample of lineitem on l_orderkey");
//
//        vc.executeJdbcQuery("create universe sample of lineitem on l_partkey");
//
//        vc.executeJdbcQuery("create uniform sample of orders");
//
//        vc.executeJdbcQuery("create universe sample of o_orderkey");

        vc.destroy();
    }

}

@@ -733,34 +733,32 @@
 conf);%0A        %0A
-//
         vc.execu
@@ -773,36 +773,35 @@
 ery(%22set bypass=
-fals
+tru
 e%22);%0A        vc.
@@ -861,18 +861,16 @@
 dict%22);%0A
-//
         
@@ -905,24 +905,28 @@
 ass=false%22);
+    
 %0A        %0A//
@@ -986,32 +986,34 @@
                %0A
+//
         vc.execu

test sample