小编hhw*_*www的帖子

创建分区时,Amazon Athena 返回“mismatched input 'partitioned' waiting {, 'with'}”错误

我想使用此查询在 Amazon Athena 中创建分区表:

CREATE TABLE IF NOT EXISTS 
 testing.partitioned_test(order_id bigint, name string, car string, country string)
 PARTITIONED BY (year int)
 ROW FORMAT SERDE 'parquet.hive.serde.ParquetHiveSerDe'
 STORED AS 'PARQUET'
 LOCATION 's3://testing-imcm-into/partitions'
Run Code Online (Sandbox Code Playgroud)

不幸的是,我没有收到告诉我以下内容的错误消息:

第 3:2 行:不匹配的输入“分区”需要 {, 'with'}

sql partitioning amazon-web-services amazon-athena

3
推荐指数
1
解决办法
2万
查看次数

列表理解与列表列表

我有问题要理解下面这段代码:

treePositions :: Tree a -> [[Int]]
treePositions (Node _ ts) =
    [] : [ (i : is ) | i <- [0..(length ts - 1)],
    is <- treePositions (index ts i) ]
Run Code Online (Sandbox Code Playgroud)

此函数将计算到给定树中某个位置的任何有效路径,其中每个节点的边缘都标有0..lastOutgoingEdge.如果我理解正确,索引函数将返回树的节点列表中的索引i处的节点.

index :: [a] -> Int -> a
index :: [a] -> Int -> a
index [] i = error "invalid index"
index (x:xs) 0 = x
index (x:xs) i = ith xs (i-1) 
Run Code Online (Sandbox Code Playgroud)

现在对于给定的树木:

t1 = Node "a" [
        Node "b" [
            Node "c"[],
            Node "d"[] …
Run Code Online (Sandbox Code Playgroud)

haskell list-comprehension

0
推荐指数
1
解决办法
519
查看次数