Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When importing Oracle data, it is not possible to use the Oracle built-in json_value function. #120

Closed
vision-wx opened this issue Dec 2, 2022 · 1 comment
Labels
type/feature req Type: feature request

Comments

@vision-wx
Copy link

软件版本

  • spark2.4.3
  • nebula-exchange_spark_2.4-3.3.0.jar
  • oracle19.3

执行SQL

SELECT UNIQUE_ID unique_id, json_value(ATTRS, '$.node_name') as node_name  FROM KG_NODE_INFO WHERE NODE_TYPE='xxx' and APPID='xxx'

报错信息

Caused by: org.apache.spark.sql.AnalysisException: Undefined function: 'json_value'. This function is neither a registered temporary function nor a permanent function registered in the database 'default'.; line 1 pos 28
	at org.apache.spark.sql.catalyst.analysis.Analyzer$LookupFunctions$$anonfun$apply$15$$anonfun$applyOrElse$49.apply(Analyzer.scala:1281)
	at org.apache.spark.sql.catalyst.analysis.Analyzer$LookupFunctions$$anonfun$apply$15$$anonfun$applyOrElse$49.apply(Analyzer.scala:1281)
	at org.apache.spark.sql.catalyst.analysis.package$.withPosition(package.scala:53)
	at org.apache.spark.sql.catalyst.analysis.Analyzer$LookupFunctions$$anonfun$apply$15.applyOrElse(Analyzer.scala:1280)
	at org.apache.spark.sql.catalyst.analysis.Analyzer$LookupFunctions$$anonfun$apply$15.applyOrElse(Analyzer.scala:1272)
	at org.apache.spark.sql.catalyst.trees.TreeNode$$anonfun$2.apply(TreeNode.scala:256)
	at org.apache.spark.sql.catalyst.trees.TreeNode$$anonfun$2.apply(TreeNode.scala:256)
	at org.apache.spark.sql.catalyst.trees.CurrentOrigin$.withOrigin(TreeNode.scala:70)
	at org.apache.spark.sql.catalyst.trees.TreeNode.transformDown(TreeNode.scala:255)
	at org.apache.spark.sql.catalyst.trees.TreeNode$$anonfun$transformDown$1.apply(TreeNode.scala:261)
	at org.apache.spark.sql.catalyst.trees.TreeNode$$anonfun$transformDown$1.apply(TreeNode.scala:261)
	at org.apache.spark.sql.catalyst.trees.TreeNode$$anonfun$4.apply(TreeNode.scala:326)
	at org.apache.spark.sql.catalyst.trees.TreeNode.mapProductIterator(TreeNode.scala:187)
	at org.apache.spark.sql.catalyst.trees.TreeNode.mapChildren(TreeNode.scala:324)
	at org.apache.spark.sql.catalyst.trees.TreeNode.transformDown(TreeNode.scala:261)
	at org.apache.spark.sql.catalyst.plans.QueryPlan$$anonfun$transformExpressionsDown$1.apply(QueryPlan.scala:83)
	at org.apache.spark.sql.catalyst.plans.QueryPlan$$anonfun$transformExpressionsDown$1.apply(QueryPlan.scala:83)
	at org.apache.spark.sql.catalyst.plans.QueryPlan$$anonfun$1.apply(QueryPlan.scala:105)
	at org.apache.spark.sql.catalyst.plans.QueryPlan$$anonfun$1.apply(QueryPlan.scala:105)
	at org.apache.spark.sql.catalyst.trees.CurrentOrigin$.withOrigin(TreeNode.scala:70)
@Nicole00 Nicole00 added the type/feature req Type: feature request label Dec 14, 2022
@QingZ11 QingZ11 changed the title 导入Oracle数据时,没法使用oracle自带的json_value函数 When importing Oracle data, it is not possible to use the Oracle built-in json_value function. Sep 18, 2023
@Nicole00
Copy link
Contributor

Nicole00 commented Dec 5, 2023

because the sql is executed in Spark SQL, but not in Oracle.

Use JDBC as the datasource can fix this. https://github.com/vesoft-inc/nebula-exchange/blob/master/exchange-common/src/main/resources/config_template/jdbc.conf

@Nicole00 Nicole00 closed this as completed Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature req Type: feature request
Projects
None yet
Development

No branches or pull requests

2 participants