Skip to content

Commit

Permalink
Add Glue metastore query runner to Hive connector
Browse files Browse the repository at this point in the history
  • Loading branch information
ebyhr committed Oct 29, 2024
1 parent 91b86e3 commit a414142
Showing 1 changed file with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -400,4 +400,31 @@ public static void main(String[] args)
log.info("\n====\n%s\n====", queryRunner.getCoordinator().getBaseUrl());
}
}

public static final class HiveGlueQueryRunnerMain
{
private HiveGlueQueryRunnerMain() {}

public static void main(String[] args)
throws Exception
{
// Requires AWS credentials, which can be provided any way supported by the DefaultProviderChain
// See https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.html#credentials-default
//noinspection resource
DistributedQueryRunner queryRunner = HiveQueryRunner.builder(testSessionBuilder()
.setCatalog("hive")
.setSchema("tpch")
.build())
.addCoordinatorProperty("http-server.http.port", "8080")
.addHiveProperty("hive.metastore", "glue")
.addHiveProperty("hive.metastore.glue.default-warehouse-dir", "local:///glue")
.addHiveProperty("hive.security", "allow-all")
.setCreateTpchSchemas(false)
.build();

Logger log = Logger.get(HiveGlueQueryRunnerMain.class);
log.info("======== SERVER STARTED ========");
log.info("\n====\n%s\n====", queryRunner.getCoordinator().getBaseUrl());
}
}
}

0 comments on commit a414142

Please sign in to comment.