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 Object
coerce(org.apache.arrow.vector.FieldVector vector, Object value)
static String
fixCaseForDatasetName(String projectName, String datasetName, com.google.cloud.bigquery.BigQuery bigQuery)
BigQuery is case sensitive for its Project and Dataset Names.static String
fixCaseForTableName(String projectName, String datasetName, String tableName, com.google.cloud.bigquery.BigQuery bigQuery)
static com.google.cloud.bigquery.BigQuery
getBigQueryClient(Map<String,String> configOptions)
static List<org.apache.arrow.vector.types.pojo.Field>
getChildFieldList(com.google.cloud.bigquery.Field field)
static Object
getComplexObjectFromFieldValue(org.apache.arrow.vector.types.pojo.Field field, com.google.cloud.bigquery.FieldValue fieldValue, boolean isTimeStampCol)
static com.google.auth.Credentials
getCredentialsFromSecretsManager(Map<String,String> configOptions)
static String
getEnvBigQueryCredsSmId(Map<String,String> configOptions)
static void
installGoogleCredentialsJsonFile(Map<String,String> configOptions)
Install/place Google cloud platform credentials from AWS secret manager to temp location This is required for dataset apistatic void
setupNativeEnvironmentVariables()
-
-
-
Method Detail
-
getCredentialsFromSecretsManager
public static com.google.auth.Credentials getCredentialsFromSecretsManager(Map<String,String> configOptions) throws IOException
- Throws:
IOException
-
getBigQueryClient
public static com.google.cloud.bigquery.BigQuery getBigQueryClient(Map<String,String> configOptions) 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
-
-