A project ID is required
See original GitHub issueHi,
I try to use the spark connector on my Apache Spark cluster with Scala but can’t because of the following error: java.lang.IllegalArgumentException: A project ID is required for this service but could not be determined from the builder or the environment. Please set a project ID using the builder.
Here my code
import org.apache.spark.sql.SparkSession
import com.google.cloud.spark.bigquery._
val spark = SparkSession.builder
.getOrCreate()
spark.conf.set("credentialsFile", "my.json")
spark.read.bigquery("project_id.datasets.tablel")
I installed spark_bigquery_latest.jar on the cluster and even try the global environment variable option but nothing works.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Project ID is required - Ethereum Stack Exchange
You need to: Sign up with Infura.io · Login into Infura.io; Click CREATE NEW PROJECT button and enter project name. Then in project...
Read more >How to fix error: A project ID is required for this service but ...
In my case the next code is working: BigQuery bigquery = BigQueryOptions.newBuilder().setProjectId("XXXXX") .
Read more >Creating and managing projects - Google Cloud
Project ID: A globally unique identifier for your project. A project ID is a unique string used to differentiate your project from all...
Read more >Locate the project ID - API Console Help - Google Help
There are two ways to identify your project: the project name and project ID. ... The project ID is a unique identifier for...
Read more >error create token HTTPError: project id required - Bugs
Make sure you are passing authentication when making requests. Project id and project secret are required when using Infura IPFS. rik ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @morganvill
Is the credential file a personal one or a service account? Personal credentials files do not contain the project id. You can either set the parent project id in the code in the read option:
spark.read.format("bigquery").option("parentProject", "<your-gcp-project-id>").option("table", "project_id.datasets.tablel").load()
; Alternatively you can set theGOOGLE_CLOUD_PROJECT
environment variable, pointing to your project id.Adding the option .option(“parentProject”, “<your-gcp-project-id>”) did the trick for me. Thanks for the help!