Class BigQueryUtils
- java.lang.Object
-
- com.amazonaws.athena.connectors.google.bigquery.BigQueryUtils
-
public class BigQueryUtils extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Objectcoerce(org.apache.arrow.vector.FieldVector vector, Object value)static StringfixCaseForDatasetName(String projectName, String datasetName, com.google.cloud.bigquery.BigQuery bigQuery)BigQuery is case sensitive for its Project and Dataset Names.static StringfixCaseForTableName(String projectName, String datasetName, String tableName, com.google.cloud.bigquery.BigQuery bigQuery)static com.google.cloud.bigquery.BigQuerygetBigQueryClient(Map<String,String> configOptions)static com.google.cloud.bigquery.BigQuerygetBigQueryClient(Map<String,String> configOptions, String secret)static List<org.apache.arrow.vector.types.pojo.Field>getChildFieldList(com.google.cloud.bigquery.Field field)static ObjectgetComplexObjectFromFieldValue(org.apache.arrow.vector.types.pojo.Field field, com.google.cloud.bigquery.FieldValue fieldValue, boolean isTimeStampCol)static com.google.auth.CredentialsgetCredentialsFromSecret(String secret)static com.google.auth.CredentialsgetCredentialsFromSecretsManager(Map<String,String> configOptions)static StringgetEnvBigQueryCredsSmId(Map<String,String> configOptions)static voidinstallGoogleCredentialsJsonFile(Map<String,String> configOptions)Install/place Google cloud platform credentials from AWS secret manager to temp location This is required for dataset apistatic voidsetupNativeEnvironmentVariables()
-
-
-
Method Detail
-
getCredentialsFromSecretsManager
public static com.google.auth.Credentials getCredentialsFromSecretsManager(Map<String,String> configOptions) throws IOException
- Throws:
IOException
-
getCredentialsFromSecret
public static com.google.auth.Credentials getCredentialsFromSecret(String secret) throws IOException
- Throws:
IOException
-
getBigQueryClient
public static com.google.cloud.bigquery.BigQuery getBigQueryClient(Map<String,String> configOptions) throws IOException
- Throws:
IOException
-
getBigQueryClient
public static com.google.cloud.bigquery.BigQuery getBigQueryClient(Map<String,String> configOptions, String secret) throws IOException
- Throws:
IOException
-
getEnvBigQueryCredsSmId
public static String getEnvBigQueryCredsSmId(Map<String,String> configOptions)
-
fixCaseForDatasetName
public static String fixCaseForDatasetName(String projectName, String datasetName, com.google.cloud.bigquery.BigQuery bigQuery)
BigQuery is case sensitive for its Project and Dataset Names. This function will return the first case insensitive match.- Parameters:
projectName- The dataset name we want to look up. The project name must be case correct.- Returns:
- A case correct dataset name.
-
fixCaseForTableName
public static String fixCaseForTableName(String projectName, String datasetName, String tableName, com.google.cloud.bigquery.BigQuery bigQuery)
-
getChildFieldList
public static List<org.apache.arrow.vector.types.pojo.Field> getChildFieldList(com.google.cloud.bigquery.Field field)
-
installGoogleCredentialsJsonFile
public static void installGoogleCredentialsJsonFile(Map<String,String> configOptions) throws IOException
Install/place Google cloud platform credentials from AWS secret manager to temp location This is required for dataset api- Throws:
IOException
-
setupNativeEnvironmentVariables
public static void setupNativeEnvironmentVariables()
-
getComplexObjectFromFieldValue
public static Object getComplexObjectFromFieldValue(org.apache.arrow.vector.types.pojo.Field field, com.google.cloud.bigquery.FieldValue fieldValue, boolean isTimeStampCol) throws ParseException
- Throws:
ParseException
-
-