Comments (12)
Same error .. just coming to post this same problem.
Code works fine from Google Cloud but when run from my desktop using credentials it fails with the above.
Java.lang.ClassNotFoundException: java.lang.ProcessEnvironment$Variable
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.samelamin.spark.bigquery.utils.EnvHacker$.setEnv(EnvHacker.scala:15)
at com.samelamin.spark.bigquery.BigQueryClient$.setGoogleBQEnvVariable(BigQueryClient.scala:51)
at com.samelamin.spark.bigquery.BigQueryClient$.getInstance(BigQueryClient.scala:34)
at com.samelamin.spark.bigquery.BigQuerySQLContext.bq$lzycompute(BigQuerySQLContext.scala:19)
at com.samelamin.spark.bigquery.BigQuerySQLContext.bq(BigQuerySQLContext.scala:19)
at com.samelamin.spark.bigquery.BigQuerySQLContext.setBigQueryDatasetLocation(BigQuerySQLContext.scala:65)
at com.bbmtek.external.DfpSdSupplyDemandTest$$anonfun$1.apply$mcV$sp(DfpSdSupplyDemandTest.scala:35)
at com.bbmtek.external.DfpSdSupplyDemandTest$$anonfun$1.apply(DfpSdSupplyDemandTest.scala:22)
at com.bbmtek.external.DfpSdSupplyDemandTest$$anonfun$1.apply(DfpSdSupplyDemandTest.scala:22)
at org.scalatest.OutcomeOf$class.outcomeOf(OutcomeOf.scala:85)
at org.scalatest.OutcomeOf$.outcomeOf(OutcomeOf.scala:104)
at org.scalatest.Transformer.apply(Transformer.scala:22)
at org.scalatest.Transformer.apply(Transformer.scala:20)
at org.scalatest.FunSuiteLike$$anon$1.apply(FunSuiteLike.scala:186)
at org.scalatest.TestSuite$class.withFixture(TestSuite.scala:196)
at org.scalatest.FunSuite.withFixture(FunSuite.scala:1560)
from spark-bigquery.
from spark-bigquery.
Scala .. must be something in my desktop config - it works on the google cloud vm.
On gcp box I run ..
spark-shell --packages com.github.samelamin:spark-bigquery_2.11:0.2.2,com.github.databricks:spark-avro:204864b6cf < test.scala
If I run via intellij on my desktop ..
It fails on the last line ... note that I dont have the JsonKey line in the code when I run on gcp.
import com.samelamin.spark.bigquery._
spark.sqlContext.setGcpJsonKeyFile(s"$resources/BIGDATA-CREDENTIALS.json")
spark.sqlContext.setBigQueryProjectId("bbm-production-bigdata")
spark.sqlContext.setBigQueryGcsBucket("bbm-production-bigdata")
spark.sqlContext.setBigQueryDatasetLocation("US")
from spark-bigquery.
from spark-bigquery.
Windows .. I tried setting the GOOGLE_APPLICATION_CREDENTIALS. First time it said it couldnt find the file then I renamed and it found it. Got the above error. So I removed it thinking I could just use the api call instead but still get the error.
using jdk1.8.0_144 and jre1.8.0_111
Are you able to share any intelij settings that might be relevant?
I have your bigquery_2.11-0.2.2.jar
along with the spark2.2.0-bin-hadoop2.7 jars
from spark-bigquery.
Is the json creds file something similar to ..
{
"type": "service_account",
"project_id": "xxxx",
"private_key_id": "xxxxxxa",
"private_key": "-----BEGIN PRIVATE KEY-----\n
blah blah blah
from spark-bigquery.
from spark-bigquery.
Did you say you didnt use an environment variable? or you do? Did you do anything special? I did in windows environment VARIABLE="/path/to/.json"
from spark-bigquery.
from spark-bigquery.
I am closing this issue as I have not heard anything back and I cannot replicate it
from spark-bigquery.
A member of our team here found the issue . it is the hack for read/writing environment variables that doesnt work on windows. He commented out the code as it wasn't apparently required. setting a hadoop environment variable?
com.samelamin.spark.bigquery.utils.EnvHacker
from spark-bigquery.
from spark-bigquery.
Related Issues (20)
- class cast exception has occurs (Double cannot be cast to Float) HOT 3
- Using spark-bigquery connector in AWS EMR Zeppelin HOT 4
- java.lang.ClassCastException: java.lang.Long cannot be cast to java.sql.Timestamp HOT 1
- Write to bigquery using DataframeWriter HOT 2
- runDMLQuery on AWS Glue throws an exception because of Jersey libraries conflict HOT 1
- read table second time show error Conflict occurred creating export directory HOT 1
- Error when changing zone to something other than EU/US HOT 3
- DML query drop and create table takes time HOT 3
- Utilize Bigquery Storage API HOT 2
- getting java.lang.NoSuchMethodError on saveAsBigQueryTable HOT 1
- Exception in thread "main" java.lang.NoSuchMethodError: HOT 14
- Struck with error py4j.protocol.Py4JJavaError: An error occurred while calling o39.saveAsBigQueryTable. : java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;Ljava/lang/Object;Ljava/lang/Object;) HOT 6
- Give content of JSON credentials instead of path to it HOT 2
- Big query export from GCP to AWS S3 using Spark HOT 2
- saveAsBigQueryTable exception with StructType column HOT 1
- Export FS must derive from GoogleHadoopFileSystemBase HOT 1
- writing to bigquery from dataproc HOT 1
- Method saveAsBigQueryTable([class java.lang.String]) does not exist: Issue persists even after shading guava dependecies HOT 4
- Conflict occurred creating export directory already exists HOT 1
- 404 not found: Job <job name> not found error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spark-bigquery.