package org.rakam.report;


import com.facebook.presto.sql.tree.QualifiedName;
import com.fasterxml.jackson.annotation.JsonCreator;

import java.util.Optional;

public interface QueryExecutor {
    QueryExecution executeRawQuery(String sqlQuery);
    QueryExecution executeRawStatement(String sqlQuery);
    String formatTableReference(String project, QualifiedName name, Optional<Sample> sample);

    class Sample {
        public final SampleMethod method;
        public final int percentage;

        @JsonCreator
        public Sample(SampleMethod method, int percentage) {
            this.method = method;
            this.percentage = percentage;
        }

        public enum SampleMethod {
            BERNOULLI, SYSTEM
        }
    }
}

@@ -20,17 +20,16 @@
 eport;%0A%0A
-%0A
 import c
@@ -123,16 +123,136 @@
 Creator;
+%0Aimport com.fasterxml.jackson.annotation.JsonProperty;%0Aimport com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
 %0A%0Aimport
@@ -303,17 +303,17 @@
 Executor
- 
+%0A
 %7B%0A    Qu
@@ -355,24 +355,25 @@
  sqlQuery);%0A
+%0A
     QueryExe
@@ -417,16 +417,17 @@
 Query);%0A
+%0A
     Stri
@@ -529,16 +529,20 @@
 s Sample
+%0A   
  %7B%0A     
@@ -663,28 +663,113 @@
 ple(
-SampleMethod method,
+%0A                @JsonProperty(%22method%22) SampleMethod method,%0A                @JsonProperty(%22percentage%22)
  int
@@ -780,16 +780,24 @@
 centage)
+%0A       
  %7B%0A     
@@ -910,16 +910,24 @@
 leMethod
+%0A       
  %7B%0A     

add json annotations to sample class