-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
register googleDialect for jdbc to support BigQuery datasource (#147)
* add note for version restriction * register googleDialect for jdbc to support BigQuery datasource * add config template for bigquery
- Loading branch information
Showing
5 changed files
with
118 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# Use the command to submit the exchange job: | ||
|
||
# spark-submit \ | ||
# --master "spark://master_ip:7077" \ | ||
# --driver-memory=2G --executor-memory=30G \ | ||
# --num-executors=3 --executor-cores=20 \ | ||
# --jars $(echo /bigquery-jdbc-dependency-path/*.jar | tr ' ' ',') | ||
# --class com.vesoft.nebula.exchange.Exchange \ | ||
# nebula-exchange-3.0-SNAPSHOT.jar -c bigquery_datasource.conf | ||
|
||
# you can get all dependency jars for bigquery from https://cloud.google.com/bigquery/docs/reference/odbc-jdbc-drivers?hl=zh-cn#jdbc_release_1331004 | ||
{ | ||
# Spark config | ||
spark: { | ||
app: { | ||
name: NebulaGraph Exchange | ||
} | ||
} | ||
|
||
# Nebula Graph config | ||
nebula: { | ||
address:{ | ||
graph: ["127.0.0.1:9669"] | ||
# if your NebulaGraph server is in virtual network like k8s, please config the leader address of meta. | ||
# use `SHOW meta leader` to see your meta leader's address | ||
meta: ["127.0.0.1:9559"] | ||
} | ||
user: root | ||
pswd: nebula | ||
space: test | ||
|
||
# nebula client connection parameters | ||
connection { | ||
# socket connect & execute timeout, unit: millisecond | ||
timeout: 30000 | ||
} | ||
|
||
error: { | ||
# max number of failures, if the number of failures is bigger than max, then exit the application. | ||
max: 32 | ||
# failed data will be recorded in output path, format with ngql | ||
output: /tmp/errors | ||
} | ||
|
||
# use google's RateLimiter to limit the requests send to NebulaGraph | ||
rate: { | ||
# the stable throughput of RateLimiter | ||
limit: 1024 | ||
# Acquires a permit from RateLimiter, unit: MILLISECONDS | ||
# if it can't be obtained within the specified timeout, then give up the request. | ||
timeout: 1000 | ||
} | ||
} | ||
|
||
# Processing tags | ||
tags: [ | ||
{ | ||
name: tag-name-1 | ||
type: { | ||
source: jdbc | ||
sink: client | ||
} | ||
|
||
# bigquery url, the auth way if configed in url. In this example, OAuthPvtKeyPath=/tmp/bq-reader-sa-key.json file should be accessible for all spark workers. | ||
url:"jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;ProjectId=nebula-cloud-test;OAuthType=0;OAuthServiceAcctEmail=bq-reader@nebula-cloud-test.iam.gserviceaccount.com;OAuthPvtKeyPath=/tmp/bq-reader-sa-key.json" | ||
# JDBC driver | ||
driver:"com.simba.googlebigquery.jdbc.Driver" | ||
|
||
user:"[email protected]" | ||
password:"12345" | ||
|
||
table:"db.person" | ||
sentence:"select id,firstName,lastName,gender from person" | ||
|
||
fields: [firstName, lastName, gender] | ||
nebula.fields: [nebula-field-0, nebula-field-1, nebula-field-2] | ||
vertex: { | ||
field: id | ||
} | ||
batch: 2000 | ||
partition: 60 | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters