Skip to content

kamiru78/be-bigquery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 

Repository files navigation

# Be-BigQuery Be-BigQuery is a BigQuery client and has simple interfaces.

Installation

<dependency>
    <groupId>com.github.kamiru78</groupId>
    <artifactId>be-bigquery</artifactId>
    <version>0.5.0</version>
</dependency>

Examples

Execute a query simply

BeBigQuery bbq = new BeBigQuery("project-id", "servic-account" , new File("path/file.p12"));
Iterable tableRows = bbq.query("select * from dataset.table where condition=11").asIterable();
for (TableRow row : tableRows) {
    for (TableCell cell : row.getF()) {
        System.out.print(cell.getV().toString() + ",");
    }
    System.out.println();
}

Execute a query and get large results

Iterable tableRows = bbq.query("select * from dataset.table where condition=11")
    .asIterableViaGcs("temp_dataset", "temp_gcs_buckt");

Use BigQuery with Apache Spark as input data

// scala sample
val bbq = new BeBigQuery("project-id" , "servic-account", new File("path/file.p12"))
bbq.query("select * from dataset.table where condition=11")
    .exportToGcs("tempDataset", "tempTable", "gcsBucket", "gcsPath/*")
val textFile = sc.textFile("gs://gcsBucket/gcsPath/")

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages