datasetName: dataset name (string)
tableName: table in the data set (string)
list: records to be inserted (List of dictionaries)
Return:
A Result object indicating the success or failure of the insert operation.
importCSVIntoTable
Import data from CSV file to the dataset table. The header in the CSV file can be skipped if needed.
BigQueryApi.importCSVIntoTable(datasetName, tableName, pathToFile,
csvSchema, classAttrs, mappings, numberOfRowsToSkip)
or
BigQueryApi.importCSVIntoTable(datasetName, tableName, pathToFile, schema, numberOfRowsToSkip)
or
BigQueryApi.importCSVIntoTable(datasetName, tableName, path, fileName, schema, numberOfRowsToSkip)
parameters:
datasetName: name of the dataset (string)
tableName: name of the table in the data set (string)
pathToFile: absolute path to the file on the system (string)
csvSchema: the csv schema (List of dictionaries)
classAttrs: attributes (List of dictionaries)
mappings: mapping of attributes with schema (List of dictionaries)
numberOfRowsToSkip: if skipping rows from the top of the csv file (int)
fileName: the name of the file (string)
schema: the schema (Dictionary)
Return:
A Result object indicating the success or failure of the import operation.
importCSVbyURIIntoTable
Same as above but using the URI for CSV file location.
datasetName: name of the data set (string)
tableName: name of the table in the dataset (string)
sourceUri: the uri of source file (string)
schema: the scheme of the csv (Dictionary)
numberOfRowsToSkip: csv line to skip from the start
Return:
A Result object indicating the success or failure of the import operation.
exportTableToCSV
Exports dataset table into a CSV file.
BigQueryApi.exportTableToCSV(
datasetName,
tableName,
pathToFile)
or
BigQueryApi.exportTableToCSV(
datasetName,
tableName,
Stringath, fileName)
parameters:
datasetName: name of the data set (string)
tableName: name of the table in the data set (string)
pathToFile: path to the CSV file (string)
path: same as above (string)
fileName: name of the file (string)
Return:
A Result object indicating the success or failure of the export operation.
exportTableToCSVByURI
Same as above but using the URI for the csv file location
datasetName: name of the data set (string)
tableName: name of the table in the data set (string)
destinationUri: the destination uri of csv file (string)
Return:
A Result object indicating the success or failure of the export operation.
exportTable
Export a table of the dataset to a file type with the destination uri provided.
datasetName: name of the dataset (string)
tableName: name of the table in the dataset (string)
destinationUri: destination uri (string)
dataFormat: format of the exported data (string)
Return:
A Result object indicating the success or failure of the export operation.
bigQueryToCSV
export data set table with specific columns to a CSV.
filePath: the path of the CSV file (string)
columnNames: table column names (list of strings)
dataSetName: name of the data set (string)
bqTableName: name of table (string)
query: query to run (string)
functionName: extra function to be called (string)
Return:
A Result object indicating the success or failure of the export operation.
getpage
Retrieve a page of data from BigQuery.
BigQueryApi.getPage(query, start, size)
Parameters
query (string)
start (int)
size (int)
Returns
A Result object containing the requested page of data.
createTableFromCSV
Create table from CSV
BigQueryApi.createTableFromCSV(datasetName, tableName, bucketFileName)
or
BigQueryApi.createTableFromCSV(datasetName, tableName, bucketName, bucketFileName)