BigQueryLoader Constructor(String,BigQueryConnection)
Initializes a new instance of the
BigQueryLoader class with table name that will be loaded and a
BigQueryConnection object.
The following example creates a
BigQueryLoader and sets some of its properties. Then prepares data and loads it into the table.
|
|---|
public void CreateMyLoader()
{
// Create and open connection
BigQueryConnection conn = new BigQueryConnection(
@"Authentication Type=ServiceAccount;ServiceAccount Json=C:\keys\service-account.json;Project Id=your_project;DataSet Id=your_dataset;License Key=**********");
conn.Open();
// Create loader instance
BigQueryLoader loader = new BigQueryLoader("loader_test", conn);
// Prepare for loading
loader.Open();
// Set row values
for (int i = 0; i < 10000; i++) {
loader.SetValue(0, i);
loader.SetValue(1, "test string");
loader.SetValue(2, DateTime.Now);
// Load next table row
loader.NextRow();
}
// Flush buffer and finish loading
loader.Close();
} |
|
|---|
Public Sub CreateMyLoader()
' Create and open connection
Dim conn As BigQueryConnection = new BigQueryConnection( _
"Authentication Type=ServiceAccount;ServiceAccount Json=C:\keys\service-account.json;Project Id=your_project;DataSet Id=your_dataset;License Key=**********")
conn.Open()
' Create loader instance
Dim loader As BigQueryLoader = new BigQueryLoader("loader_test", conn)
' Prepare for loading
loader.Open()
' Set row values
Dim i As Integer
For i = 0 To 10000
loader.SetValue(0, i)
loader.SetValue(1, "test string")
loader.SetValue(2, DateTime.Now)
' Load next table row
loader.NextRow()
next
' Flush buffer and finish loading
loader.Close()
End Sub |
Reference
BigQueryLoader Class
BigQueryLoader Members
Overload List
Devart.Data.BigQuery.BigQueryLoaderColumn
Devart.Data.BigQuery.BigQueryLoaderColumnCollection