public class org.apache.drill.exec.store.googlesheets.TestGoogleSheetsLimitPushdown extends org.apache.drill.test.ClusterTest
{
private static final java.lang.String AUTH_URI;
private static final java.lang.String TOKEN_URI;
private static final java.util.List REDIRECT_URI;
private static org.apache.drill.exec.store.StoragePluginRegistry pluginRegistry;
private static java.lang.String accessToken;
private static java.lang.String refreshToken;
private static java.lang.String sheetID;
public void <init>()
{
org.apache.drill.exec.store.googlesheets.TestGoogleSheetsLimitPushdown v;
v := @this: org.apache.drill.exec.store.googlesheets.TestGoogleSheetsLimitPushdown;
specialinvoke v.<org.apache.drill.test.ClusterTest: void <init>()>();
return;
}
public static void init() throws java.lang.Exception
{
org.apache.drill.test.BaseDirTestWatcher v;
org.apache.drill.shaded.guava.com.google.common.io.CharSource v;
org.apache.drill.exec.store.googlesheets.GoogleSheetsStoragePluginConfig v;
java.util.List v;
org.apache.drill.test.ClusterFixtureBuilder v, v, v, v;
org.apache.drill.exec.store.StoragePluginRegistry v, v;
org.apache.drill.exec.server.Drillbit v, v;
org.apache.drill.exec.server.DrillbitContext v;
java.nio.charset.Charset v;
java.lang.Boolean v, v, v, v, v, v;
java.lang.String v;
org.apache.drill.exec.store.googlesheets.GoogleSheetsStoragePluginConfig$GoogleSheetsStoragePluginConfigBuilder v, v, v, v, v, v, v, v;
org.apache.drill.test.ClusterFixture v, v;
com.fasterxml.jackson.databind.ObjectMapper v;
java.io.File v;
java.lang.Object v, v, v, v, v, v;
v = staticinvoke <org.apache.drill.common.util.DrillFileUtils: java.io.File getResourceAsFile(java.lang.String)>("/tokens/oauth_tokens.json");
v = <org.apache.drill.shaded.guava.com.google.common.base.Charsets: java.nio.charset.Charset UTF_8>;
v = staticinvoke <org.apache.drill.shaded.guava.com.google.common.io.Files: org.apache.drill.shaded.guava.com.google.common.io.CharSource asCharSource(java.io.File,java.nio.charset.Charset)>(v, v);
v = virtualinvoke v.<org.apache.drill.shaded.guava.com.google.common.io.CharSource: java.lang.String read()>();
v = new com.fasterxml.jackson.databind.ObjectMapper;
specialinvoke v.<com.fasterxml.jackson.databind.ObjectMapper: void <init>()>();
v = virtualinvoke v.<com.fasterxml.jackson.databind.ObjectMapper: java.lang.Object readValue(java.lang.String,java.lang.Class)>(v, class "Ljava/util/Map;");
v = interfaceinvoke v.<java.util.Map: java.lang.Object get(java.lang.Object)>("client_id");
v = interfaceinvoke v.<java.util.Map: java.lang.Object get(java.lang.Object)>("client_secret");
v = interfaceinvoke v.<java.util.Map: java.lang.Object get(java.lang.Object)>("access_token");
<org.apache.drill.exec.store.googlesheets.TestGoogleSheetsLimitPushdown: java.lang.String accessToken> = v;
v = interfaceinvoke v.<java.util.Map: java.lang.Object get(java.lang.Object)>("refresh_token");
<org.apache.drill.exec.store.googlesheets.TestGoogleSheetsLimitPushdown: java.lang.String refreshToken> = v;
v = interfaceinvoke v.<java.util.Map: java.lang.Object get(java.lang.Object)>("sheet_id");
<org.apache.drill.exec.store.googlesheets.TestGoogleSheetsLimitPushdown: java.lang.String sheetID> = v;
v = new org.apache.drill.test.ClusterFixtureBuilder;
v = <org.apache.drill.exec.store.googlesheets.TestGoogleSheetsLimitPushdown: org.apache.drill.test.BaseDirTestWatcher dirTestWatcher>;
specialinvoke v.<org.apache.drill.test.ClusterFixtureBuilder: void <init>(org.apache.drill.test.BaseDirTestWatcher)>(v);
v = staticinvoke <java.lang.Boolean: java.lang.Boolean valueOf(boolean)>(1);
v = virtualinvoke v.<org.apache.drill.test.ClusterFixtureBuilder: org.apache.drill.test.ClusterFixtureBuilder configProperty(java.lang.String,java.lang.Object)>("drill.exec.http.enabled", v);
v = staticinvoke <java.lang.Boolean: java.lang.Boolean valueOf(boolean)>(1);
v = virtualinvoke v.<org.apache.drill.test.ClusterFixtureBuilder: org.apache.drill.test.ClusterFixtureBuilder configProperty(java.lang.String,java.lang.Object)>("drill.exec.http.porthunt", v);
v = staticinvoke <java.lang.Boolean: java.lang.Boolean valueOf(boolean)>(1);
v = virtualinvoke v.<org.apache.drill.test.ClusterFixtureBuilder: org.apache.drill.test.ClusterFixtureBuilder configProperty(java.lang.String,java.lang.Object)>("drill.exec.impersonation.enabled", v);
staticinvoke <org.apache.drill.exec.store.googlesheets.TestGoogleSheetsLimitPushdown: void startCluster(org.apache.drill.test.ClusterFixtureBuilder)>(v);
v = <org.apache.drill.exec.store.googlesheets.TestGoogleSheetsLimitPushdown: org.apache.drill.test.ClusterFixture cluster>;
v = virtualinvoke v.<org.apache.drill.test.ClusterFixture: org.apache.drill.exec.server.Drillbit drillbit()>();
virtualinvoke v.<org.apache.drill.exec.server.Drillbit: int getWebServerPort()>();
v = <org.apache.drill.exec.store.googlesheets.TestGoogleSheetsLimitPushdown: org.apache.drill.test.ClusterFixture cluster>;
v = virtualinvoke v.<org.apache.drill.test.ClusterFixture: org.apache.drill.exec.server.Drillbit drillbit()>();
v = virtualinvoke v.<org.apache.drill.exec.server.Drillbit: org.apache.drill.exec.server.DrillbitContext getContext()>();
v = virtualinvoke v.<org.apache.drill.exec.server.DrillbitContext: org.apache.drill.exec.store.StoragePluginRegistry getStorage()>();
<org.apache.drill.exec.store.googlesheets.TestGoogleSheetsLimitPushdown: org.apache.drill.exec.store.StoragePluginRegistry pluginRegistry> = v;
v = staticinvoke <org.apache.drill.exec.store.googlesheets.GoogleSheetsStoragePluginConfig: org.apache.drill.exec.store.googlesheets.GoogleSheetsStoragePluginConfig$GoogleSheetsStoragePluginConfigBuilder builder()>();
v = virtualinvoke v.<org.apache.drill.exec.store.googlesheets.GoogleSheetsStoragePluginConfig$GoogleSheetsStoragePluginConfigBuilder: org.apache.drill.exec.store.googlesheets.GoogleSheetsStoragePluginConfig$GoogleSheetsStoragePluginConfigBuilder clientID(java.lang.String)>(v);
v = virtualinvoke v.<org.apache.drill.exec.store.googlesheets.GoogleSheetsStoragePluginConfig$GoogleSheetsStoragePluginConfigBuilder: org.apache.drill.exec.store.googlesheets.GoogleSheetsStoragePluginConfig$GoogleSheetsStoragePluginConfigBuilder clientSecret(java.lang.String)>(v);
v = <org.apache.drill.exec.store.googlesheets.TestGoogleSheetsLimitPushdown: java.util.List REDIRECT_URI>;
v = virtualinvoke v.<org.apache.drill.exec.store.googlesheets.GoogleSheetsStoragePluginConfig$GoogleSheetsStoragePluginConfigBuilder: org.apache.drill.exec.store.googlesheets.GoogleSheetsStoragePluginConfig$GoogleSheetsStoragePluginConfigBuilder redirectUris(java.util.List)>(v);
v = virtualinvoke v.<org.apache.drill.exec.store.googlesheets.GoogleSheetsStoragePluginConfig$GoogleSheetsStoragePluginConfigBuilder: org.apache.drill.exec.store.googlesheets.GoogleSheetsStoragePluginConfig$GoogleSheetsStoragePluginConfigBuilder authUri(java.lang.String)>("https://accounts.google.com/o/oauth2/auth");
v = virtualinvoke v.<org.apache.drill.exec.store.googlesheets.GoogleSheetsStoragePluginConfig$GoogleSheetsStoragePluginConfigBuilder: org.apache.drill.exec.store.googlesheets.GoogleSheetsStoragePluginConfig$GoogleSheetsStoragePluginConfigBuilder tokenUri(java.lang.String)>("https://oauth.googleapis.com/token");
v = staticinvoke <java.lang.Boolean: java.lang.Boolean valueOf(boolean)>(0);
v = virtualinvoke v.<org.apache.drill.exec.store.googlesheets.GoogleSheetsStoragePluginConfig$GoogleSheetsStoragePluginConfigBuilder: org.apache.drill.exec.store.googlesheets.GoogleSheetsStoragePluginConfig$GoogleSheetsStoragePluginConfigBuilder allTextMode(java.lang.Boolean)>(v);
v = staticinvoke <java.lang.Boolean: java.lang.Boolean valueOf(boolean)>(1);
v = virtualinvoke v.<org.apache.drill.exec.store.googlesheets.GoogleSheetsStoragePluginConfig$GoogleSheetsStoragePluginConfigBuilder: org.apache.drill.exec.store.googlesheets.GoogleSheetsStoragePluginConfig$GoogleSheetsStoragePluginConfigBuilder extractHeaders(java.lang.Boolean)>(v);
v = virtualinvoke v.<org.apache.drill.exec.store.googlesheets.GoogleSheetsStoragePluginConfig$GoogleSheetsStoragePluginConfigBuilder: org.apache.drill.exec.store.googlesheets.GoogleSheetsStoragePluginConfig build()>();
v = staticinvoke <java.lang.Boolean: java.lang.Boolean valueOf(boolean)>(1);
virtualinvoke v.<org.apache.drill.exec.store.googlesheets.GoogleSheetsStoragePluginConfig: void setEnabled(java.lang.Boolean)>(v);
v = <org.apache.drill.exec.store.googlesheets.TestGoogleSheetsLimitPushdown: org.apache.drill.exec.store.StoragePluginRegistry pluginRegistry>;
interfaceinvoke v.<org.apache.drill.exec.store.StoragePluginRegistry: void validatedPut(java.lang.String,org.apache.drill.common.logical.StoragePluginConfig)>("googlesheets", v);
return;
}
public void testLimit() throws java.lang.Exception
{
java.lang.Throwable v;
org.apache.drill.test.QueryBuilder v, v;
java.lang.Object[] v;
org.apache.drill.exec.store.googlesheets.TestGoogleSheetsLimitPushdown v;
org.apache.drill.test.QueryBuilder$PlanMatcher v, v;
java.lang.String[] v;
java.lang.String v, v, v;
v := @this: org.apache.drill.exec.store.googlesheets.TestGoogleSheetsLimitPushdown;
label:
specialinvoke v.<org.apache.drill.exec.store.googlesheets.TestGoogleSheetsLimitPushdown: void initializeTokens()>();
label:
goto label;
label:
v := @caughtexception;
v = virtualinvoke v.<org.apache.drill.exec.store.StoragePluginRegistry$PluginException: java.lang.String getMessage()>();
staticinvoke <org.junit.Assert: void fail(java.lang.String)>(v);
label:
v = newarray (java.lang.Object)[1];
v = <org.apache.drill.exec.store.googlesheets.TestGoogleSheetsLimitPushdown: java.lang.String sheetID>;
v[0] = v;
v = staticinvoke <java.lang.String: java.lang.String format(java.lang.String,java.lang.Object[])>("SELECT * FROM googlesheets.`%s`.`MixedSheet` LIMIT 5", v);
v = virtualinvoke v.<org.apache.drill.exec.store.googlesheets.TestGoogleSheetsLimitPushdown: org.apache.drill.test.QueryBuilder queryBuilder()>();
v = virtualinvoke v.<org.apache.drill.test.QueryBuilder: org.apache.drill.test.QueryBuilder sql(java.lang.String)>(v);
v = virtualinvoke v.<org.apache.drill.test.QueryBuilder: org.apache.drill.test.QueryBuilder$PlanMatcher planMatcher()>();
v = newarray (java.lang.String)[2];
v[0] = "Limit";
v[1] = "maxRecords=5";
v = virtualinvoke v.<org.apache.drill.test.QueryBuilder$PlanMatcher: org.apache.drill.test.QueryBuilder$PlanMatcher include(java.lang.String[])>(v);
virtualinvoke v.<org.apache.drill.test.QueryBuilder$PlanMatcher: void match()>();
return;
catch org.apache.drill.exec.store.StoragePluginRegistry$PluginException from label to label with label;
}
public void testLimitWithOrderBy() throws java.lang.Exception
{
java.lang.Throwable v;
org.apache.drill.test.QueryBuilder v, v;
java.lang.Object[] v;
org.apache.drill.exec.store.googlesheets.TestGoogleSheetsLimitPushdown v;
org.apache.drill.test.QueryBuilder$PlanMatcher v, v;
java.lang.String[] v;
java.lang.String v, v, v;
v := @this: org.apache.drill.exec.store.googlesheets.TestGoogleSheetsLimitPushdown;
label:
specialinvoke v.<org.apache.drill.exec.store.googlesheets.TestGoogleSheetsLimitPushdown: void initializeTokens()>();
label:
goto label;
label:
v := @caughtexception;
v = virtualinvoke v.<org.apache.drill.exec.store.StoragePluginRegistry$PluginException: java.lang.String getMessage()>();
staticinvoke <org.junit.Assert: void fail(java.lang.String)>(v);
label:
v = newarray (java.lang.Object)[1];
v = <org.apache.drill.exec.store.googlesheets.TestGoogleSheetsLimitPushdown: java.lang.String sheetID>;
v[0] = v;
v = staticinvoke <java.lang.String: java.lang.String format(java.lang.String,java.lang.Object[])>("SELECT * FROM googlesheets.`%s`.`MixedSheet` ORDER BY Col LIMIT 4", v);
v = virtualinvoke v.<org.apache.drill.exec.store.googlesheets.TestGoogleSheetsLimitPushdown: org.apache.drill.test.QueryBuilder queryBuilder()>();
v = virtualinvoke v.<org.apache.drill.test.QueryBuilder: org.apache.drill.test.QueryBuilder sql(java.lang.String)>(v);
v = virtualinvoke v.<org.apache.drill.test.QueryBuilder: org.apache.drill.test.QueryBuilder$PlanMatcher planMatcher()>();
v = newarray (java.lang.String)[2];
v[0] = "Limit";
v[1] = "maxRecords=-1";
v = virtualinvoke v.<org.apache.drill.test.QueryBuilder$PlanMatcher: org.apache.drill.test.QueryBuilder$PlanMatcher include(java.lang.String[])>(v);
virtualinvoke v.<org.apache.drill.test.QueryBuilder$PlanMatcher: void match()>();
return;
catch org.apache.drill.exec.store.StoragePluginRegistry$PluginException from label to label with label;
}
public void testLimitWithOffset() throws java.lang.Exception
{
java.lang.Throwable v;
org.apache.drill.test.QueryBuilder v, v;
java.lang.Object[] v;
org.apache.drill.exec.store.googlesheets.TestGoogleSheetsLimitPushdown v;
org.apache.drill.test.QueryBuilder$PlanMatcher v, v;
java.lang.String[] v;
java.lang.String v, v, v;
v := @this: org.apache.drill.exec.store.googlesheets.TestGoogleSheetsLimitPushdown;
label:
specialinvoke v.<org.apache.drill.exec.store.googlesheets.TestGoogleSheetsLimitPushdown: void initializeTokens()>();
label:
goto label;
label:
v := @caughtexception;
v = virtualinvoke v.<org.apache.drill.exec.store.StoragePluginRegistry$PluginException: java.lang.String getMessage()>();
staticinvoke <org.junit.Assert: void fail(java.lang.String)>(v);
label:
v = newarray (java.lang.Object)[1];
v = <org.apache.drill.exec.store.googlesheets.TestGoogleSheetsLimitPushdown: java.lang.String sheetID>;
v[0] = v;
v = staticinvoke <java.lang.String: java.lang.String format(java.lang.String,java.lang.Object[])>("SELECT * FROM googlesheets.`%s`.`MixedSheet` LIMIT 4 OFFSET 5", v);
v = virtualinvoke v.<org.apache.drill.exec.store.googlesheets.TestGoogleSheetsLimitPushdown: org.apache.drill.test.QueryBuilder queryBuilder()>();
v = virtualinvoke v.<org.apache.drill.test.QueryBuilder: org.apache.drill.test.QueryBuilder sql(java.lang.String)>(v);
v = virtualinvoke v.<org.apache.drill.test.QueryBuilder: org.apache.drill.test.QueryBuilder$PlanMatcher planMatcher()>();
v = newarray (java.lang.String)[2];
v[0] = "Limit";
v[1] = "maxRecords=9";
v = virtualinvoke v.<org.apache.drill.test.QueryBuilder$PlanMatcher: org.apache.drill.test.QueryBuilder$PlanMatcher include(java.lang.String[])>(v);
virtualinvoke v.<org.apache.drill.test.QueryBuilder$PlanMatcher: void match()>();
return;
catch org.apache.drill.exec.store.StoragePluginRegistry$PluginException from label to label with label;
}
private void initializeTokens() throws org.apache.drill.exec.store.StoragePluginRegistry$PluginException
{
org.apache.drill.exec.store.StoragePluginRegistry v;
org.apache.drill.exec.oauth.PersistentTokenTable v;
org.apache.drill.exec.store.googlesheets.TestGoogleSheetsLimitPushdown v;
org.apache.drill.exec.store.StoragePlugin v;
java.lang.String v, v;
v := @this: org.apache.drill.exec.store.googlesheets.TestGoogleSheetsLimitPushdown;
v = <org.apache.drill.exec.store.googlesheets.TestGoogleSheetsLimitPushdown: org.apache.drill.exec.store.StoragePluginRegistry pluginRegistry>;
v = interfaceinvoke v.<org.apache.drill.exec.store.StoragePluginRegistry: org.apache.drill.exec.store.StoragePlugin getPlugin(java.lang.String)>("googlesheets");
virtualinvoke v.<org.apache.drill.exec.store.googlesheets.GoogleSheetsStoragePlugin: void initializeTokenTableForTesting()>();
v = virtualinvoke v.<org.apache.drill.exec.store.googlesheets.GoogleSheetsStoragePlugin: org.apache.drill.exec.oauth.PersistentTokenTable getTokenTable()>();
v = <org.apache.drill.exec.store.googlesheets.TestGoogleSheetsLimitPushdown: java.lang.String accessToken>;
virtualinvoke v.<org.apache.drill.exec.oauth.PersistentTokenTable: void setAccessToken(java.lang.String)>(v);
v = <org.apache.drill.exec.store.googlesheets.TestGoogleSheetsLimitPushdown: java.lang.String refreshToken>;
virtualinvoke v.<org.apache.drill.exec.oauth.PersistentTokenTable: void setRefreshToken(java.lang.String)>(v);
virtualinvoke v.<org.apache.drill.exec.oauth.PersistentTokenTable: void setExpiresIn(java.lang.String)>("50000");
return;
}
static void <clinit>()
{
java.lang.String[] v;
java.util.List v;
java.util.ArrayList v;
v = new java.util.ArrayList;
v = newarray (java.lang.String)[2];
v[0] = "urn:ietf:wg:oauth:2.0:oob";
v[1] = "http://localhost";
v = staticinvoke <java.util.Arrays: java.util.List asList(java.lang.Object[])>(v);
specialinvoke v.<java.util.ArrayList: void <init>(java.util.Collection)>(v);
<org.apache.drill.exec.store.googlesheets.TestGoogleSheetsLimitPushdown: java.util.List REDIRECT_URI> = v;
return;
}
}