Supported syntax of Spark SQL

http://docs.datastax.com/en/latest-dse/datastax_enterprise/spark/sparkSqlSupportedSyntax.html#

Supported syntax of Spark SQL

The following syntax defines a SELECT query.

SELECT [DISTINCT] [column names]|[wildcard] 
FROM [kesypace name.]table name 
[JOIN clause table name ON join condition]
[WHERE condition]
[GROUP BY column name]
[HAVING conditions]
[ORDER BY column names [ASC | DSC]]

SELECT query using joins has the following syntax.

SELECT statement
FROM statement
[JOIN | INNER JOIN | LEFT JOIN | LEFT SEMI JOIN | LEFT OUTER JOIN | RIGHT JOIN | RIGHT OUTER JOIN | FULL JOIN | FULL OUTER JOIN]
ON join condition

Several select clauses can be combined in a UNIONINTERSECT, or EXCEPT query.

SELECT statement 1
[UNION | UNION ALL | UNION DISTINCT | INTERSECT | EXCEPT]
SELECT statement 2
Note:  Select queries run on new columns return   '', or empty results, instead of None.

The following syntax defines an INSERT query.

INSERT [OVERWRITE] INTO [keyspace name.]table name [(columns)]
VALUES values

The following syntax defines a CACHE TABLE query.

CACHE TABLE table name [AS table alias]

You can remove a table from the cache using a UNCACHE TABLE query.

UNCACHE TABLE table name

Keywords in Spark SQL 

The following keywords are reserved in Spark SQL.

  • ALL
  • AND
  • AS
  • ASC
  • APPROXIMATE
  • AVG
  • BETWEEN
  • BY
  • CACHE
  • CAST
  • COUNT
  • DESC
  • DISTINCT
  • FALSE
  • FIRST
  • LAST
  • FROM
  • FULL
  • GROUP
  • HAVING
  • IF
  • IN
  • INNER
  • INSERT
  • INTO
  • IS
  • JOIN
  • LEFT
  • LIMIT
  • MAX
  • MIN
  • NOT
  • NULL
  • ON
  • OR
  • OVERWRITE
  • LIKE
  • RLIKE
  • UPPER
  • LOWER
  • REGEXP
  • ORDER
  • OUTER
  • RIGHT
  • SELECT
  • SEMI
  • STRING
  • SUM
  • TABLE
  • TIMESTAMP
  • TRUE
  • UNCACHE
  • UNION
  • WHERE
  • INTERSECT
  • EXCEPT
  • SUBSTR
  • SUBSTRING
  • SQRT
  • ABS

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值