title: Access AWS Glue from local Spark
body: <p><em>Is there any way to run local master Spark SQL queries against AWS Glue?</em></p>
  
  <p>Launch this code on my local PC:</p>
  
  <pre><code>SparkSession.builder()
      .master("local")
      .enableHiveSupport()
      .config("hive.metastore.client.factory.class", "com.amazonaws.glue.catalog.metastore.AWSGlueDataCatalogHiveClientFactory")
      .getOrCreate()
      .sql("show databases"); // this query isn't running against AWS Glue
  </code></pre>
  
  <p><strong>EDIT</strong>
  based on some examples it appears that the <code>hive.metastore.uris</code> configuration key should allow specifying a specific metastore url, however, it's not clear how to get the relevant value for glue</p>
  
  <pre><code>SparkSession.builder()
      .master("local")
      .enableHiveSupport()
      .config("hive.metastore.client.factory.class", "com.amazonaws.glue.catalog.metastore.AWSGlueDataCatalogHiveClientFactory")
      .config("hive.metastore.uris", "thrift://???:9083")
      .getOrCreate()
      .sql("show databases"); // this query isn't running against AWS Glue
  </code></pre>