Coder Social home page Coder Social logo

bigquery4s's Introduction

bigquery4s's People

Contributors

ara-ta3 avatar katzchang avatar kiris avatar serafdev avatar seratch avatar vijaykramesh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

bigquery4s's Issues

Connection to BQ from inside DataPRoc

Hi,
I'm trying to run my scala code from a dataproc cluster and get this error:
Exception in thread "main" java.io.FileNotFoundException: /root/.bigquery/client_secret.json (No such file or directory) at java.io.FileInputStream.open0(Native Method) at java.io.FileInputStream.open(FileInputStream.java:195) at java.io.FileInputStream.<init>(FileInputStream.java:138) at java.io.FileInputStream.<init>(FileInputStream.java:93) at bigquery4s.BigQuery$.fromClientSecretJson(BigQuery.scala:137) at bigquery4s.BigQuery$.apply(BigQuery.scala:125)
So that means its looking for fromClientSecretJson instead of fromServiceAccount, can someone suggest how to redirect it to the latter?
Thanks,

[Discussion] BigQuery API

I would like to know if you are willing to switch to use com.google.cloud.google-cloud-bigquery api instead of the current com.google.apis.google-api-services-bigquery

There is interesting functions available there using objects like FieldValue containing better typing than TableValue.

It looks like these APIs are mostly for rest apis versus the first mentioned one is a java wrapper for those, we might be able to have something closer to scalikejdbc more easily.

I have a few examples in my code that I can show that I have issues reproducing with TableCell:

protected[this] def string(columnName: String)(implicit row: FieldValueList): String = row.get(columnName).getStringValue

protected[this] def int(columnName: String)(implicit row: FieldValueList): Int = row.get(columnName).getLongValue.toInt

protected[this] def double(columnName: String)(implicit row: FieldValueList): Double = row.get(columnName).getDoubleValue

I wanted to add these to WrappedTableCell and would be a lot easier if the underlying was a FieldValue

I am willing to make a relatively big refactoring if you want to go with it @seratch I could make bigquery4s.BigQuery extend the com.google.cloud.bigquery.BigQuery (or be some kind of wrapper to it like you did) and add the credential utilities to it. We won't need pagination anymore I think. Let me know what you think!

Also another example of some of my code using FieldValues:

  def apply(implicit row: FieldValueList): Member = {
    new Member(
      stringOpt("id"),
      string("name"),
      double("x_local"),
      double("y_local"),
      timestamp("time_created")
    )
  }

 def fetch(): Seq[Member] = bqs"select * from $datasetName.$tableName".map(Member(_))

Issue on auth

Hi,

I've done the readme but it doesn't work.

WHEN I TRY THE AUTH :
val bq = BigQuery() // expects $HOME/.bigquery/client_secret.json

I've got this stacktrace :

java.lang.IllegalArgumentException
	at com.google.api.client.repackaged.com.google.common.base.Preconditions.checkArgument(Preconditions.java:111)
	at com.google.api.client.util.Preconditions.checkArgument(Preconditions.java:37)
	at com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets.getDetails(GoogleClientSecrets.java:82)
	at com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeFlow$Builder.<init>(GoogleAuthorizationCodeFlow.java:195)
	at bigquery4s.BigQuery$.fromClientSecretJson(BigQuery.scala:120)
	at bigquery4s.BigQuery$.apply(BigQuery.scala:102)

It seem's that we never setInstalled or setWeb because web and installed are null.

But in debug mode, client_id / ... are well initialized in clientSecrets.
Can you give me some support ?

Best regards,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.