假设我有2个表,如下所示.现在,如果我想获得sql将使用的结果,insert into B where id not in(select id from A)
将3 George在表B中插入.
如何在蜂巢中实现这一点?
表A.
id name
1 Rahul
2 Keshav
3 George
Run Code Online (Sandbox Code Playgroud)
表B.
id name
1 Rahul
2 Keshav
4 Yogesh
Run Code Online (Sandbox Code Playgroud) 我现在有 hive 脚本 custsales.hql 我想从 hive cli 运行它
hive (pract5)> run /user/training/hdfs_location/custsales.hql
Run Code Online (Sandbox Code Playgroud)
但它不执行。请指导。我知道我们可以从命令行运行它
$ hive -f /home/training/local_location/custsales.hql
Run Code Online (Sandbox Code Playgroud)
但这不是我的要求。
我正在Spark Shell中执行一些spark(scala)sql代码。我想知道我正在使用哪个队列,并且如果可能的话,我想知道我正在使用多少内存和执行程序,以及如何对其进行优化?
我正在使用以下函数来解析 url 但它会抛出错误,
val b = Seq(("http://spark.apache.org/path?query=1"),("https://people.apache.org/~pwendell/spark-nightly/spark-master-docs/latest/api/sql/#negative")).toDF("url_col")
.withColumn("host",parse_url($"url_col","HOST"))
.withColumn("query",parse_url($"url_col","QUERY"))
.show(false)
Run Code Online (Sandbox Code Playgroud)
错误:
<console>:285: error: not found: value parse_url
.withColumn("host",parse_url($"url_col","HOST"))
^
<console>:286: error: not found: value parse_url
.withColumn("query",parse_url($"url_col","QUERY"))
^
Run Code Online (Sandbox Code Playgroud)
请指导如何将 url 解析为不同的部分。