Skip to content

Commit 0c5444c

Browse files
[native] Use the correct session while creating a table in NativeQueryRunnerUtils
1 parent 93526d3 commit 0c5444c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

presto-native-execution/src/test/java/com/facebook/presto/nativeworker/NativeQueryRunnerUtils.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -209,19 +209,19 @@ public static void createNationWithFormat(QueryRunner queryRunner, String storag
209209
public static void createNationWithFormat(Session session, QueryRunner queryRunner, String storageFormat)
210210
{
211211
queryRunner.execute(session, "DROP TABLE IF EXISTS nation");
212-
if (storageFormat.equals("PARQUET") && !queryRunner.tableExists(queryRunner.getDefaultSession(), "nation")) {
212+
if (storageFormat.equals("PARQUET") && !queryRunner.tableExists(session, "nation")) {
213213
queryRunner.execute(session, "CREATE TABLE nation AS SELECT * FROM tpch.tiny.nation");
214214
}
215215

216-
if (storageFormat.equals("ORC") && !queryRunner.tableExists(queryRunner.getDefaultSession(), "nation")) {
216+
if (storageFormat.equals("ORC") && !queryRunner.tableExists(session, "nation")) {
217217
queryRunner.execute(session, "CREATE TABLE nation AS SELECT * FROM tpch.tiny.nation");
218218
}
219219

220-
if (storageFormat.equals("JSON") && !queryRunner.tableExists(queryRunner.getDefaultSession(), "nation_json")) {
220+
if (storageFormat.equals("JSON") && !queryRunner.tableExists(session, "nation_json")) {
221221
queryRunner.execute(session, "CREATE TABLE nation_json WITH (FORMAT = 'JSON') AS SELECT * FROM tpch.tiny.nation");
222222
}
223223

224-
if (storageFormat.equals("TEXTFILE") && !queryRunner.tableExists(queryRunner.getDefaultSession(), "nation_text")) {
224+
if (storageFormat.equals("TEXTFILE") && !queryRunner.tableExists(session, "nation_text")) {
225225
queryRunner.execute(session, "CREATE TABLE nation_text WITH (FORMAT = 'TEXTFILE') AS SELECT * FROM tpch.tiny.nation");
226226
}
227227
}
@@ -272,7 +272,7 @@ public static void createCustomer(QueryRunner queryRunner)
272272

273273
public static void createCustomer(Session session, QueryRunner queryRunner)
274274
{
275-
if (!queryRunner.tableExists(queryRunner.getDefaultSession(), "customer")) {
275+
if (!queryRunner.tableExists(session, "customer")) {
276276
queryRunner.execute(session, "CREATE TABLE customer AS " +
277277
"SELECT custkey, name, address, nationkey, phone, acctbal, comment, mktsegment " +
278278
"FROM tpch.tiny.customer");
@@ -394,7 +394,7 @@ public static void createPart(QueryRunner queryRunner)
394394

395395
public static void createPart(Session session, QueryRunner queryRunner)
396396
{
397-
if (!queryRunner.tableExists(queryRunner.getDefaultSession(), "part")) {
397+
if (!queryRunner.tableExists(session, "part")) {
398398
queryRunner.execute(session, "CREATE TABLE part AS SELECT * FROM tpch.tiny.part");
399399
}
400400
}
@@ -406,7 +406,7 @@ public static void createPartSupp(QueryRunner queryRunner)
406406

407407
public static void createPartSupp(Session session, QueryRunner queryRunner)
408408
{
409-
if (!queryRunner.tableExists(queryRunner.getDefaultSession(), "partsupp")) {
409+
if (!queryRunner.tableExists(session, "partsupp")) {
410410
queryRunner.execute(session, "CREATE TABLE partsupp AS SELECT * FROM tpch.tiny.partsupp");
411411
}
412412
}

0 commit comments

Comments
 (0)