我已经连接了Glue目录到雅典娜和一个EMR实例(预置)。我试着在这两种情况下运行相同的查询,但得到的结果不同。EMR为0行,雅典娜为43行。使用left join、group by和count distinct查询非常简单。该查询如下所示:
select
t1.customer_id as id,
t2.purchase_date as purchase_date,
count(distinct t1.purchase_id) as item_count
from
table1 t1
left join
table2 as t2
on t2.purchase_id=
我在CDH6集群上创建了一个orc文件。在这个orc文件的顶部创建了hive表。此表也是从presto使用presto单元连接器查询的。Presto安装在同一个CDH6集群上。当从presto_cli v/s hive_cli查询数据时会注意到时间差。单元-orcfiledump和单元查询都将时间戳列值返回为2021-11-08 15:09:50。
hive> select event_time from icampaign_message_history_dm where bintime=1636383600;
OK
**2021-11-08 15:09:50**
Time taken
我希望将查询输出转换为python数据框以绘制折线图 import prestodb
import pandas as pd
conn=prestodb.dbapi.connect(
host='10.0.0.101',
port=8081,
user='hive',
catalog='hive',
schema='ong',
)
cur = conn.cursor()
query="SELECT dtime,tagName FROM machine where tagname is not null
limit
我遇到了一个问题,正确地阅读时间戳,没有任何自动转换的Presto上的电子病历。
示例:在AWS Glue目录中,我有一个表,其中包含UTC时间中的时间戳列(数据类型为时间戳)。当他们在雅典娜询问时,他们会如愿以偿地回来。当在Presto中查询EMR (EMR5.26,Presto 0.220)时,会出现对不同时区的自动转换。
Presto在这里描述了禁用此行为的一种方法- 。
The legacy semantics can be enabled using the deprecated.legacy-timestamp config property. Setting it to true
有一个数据格式为20 GB的表,简单的查询只需扫描1GB的数据即可得到结果。select columns from table1 where id in (id1, id2, idn)
如果使用子查询(如- select columns from table1 where id in (select id from table2 limit n) )执行相同的查询,则该查询将通过扫描20 10提供结果,整个table.Even n为10、50或5000的非常小的数字。
左加入也是如此。
SELECT table1.* FROM
table2 LEFT JOIN table1
ON table2
在Presto中,我正在编写一个SQL来从包含6个表的视图中提取数据。这些表都很大,记录在500万到3000万之间。SQL语句如下: select
a, b, c, d
from db.schema.v_order
where
f_order_code in (
select order_code from anotherdb.schema.xxx where ......
) 我尝试从子查询中获取结果,并将子查询替换为内容,然后直接在mysql中执行此sql。它的索引速度很快。但是当我在Presto中执行这个SQL时,我发现Presto总是在没有任何where条件的情况
我正在查询具有可变长度JSON数组的列。
select col.pages[1].name, col.pages[2].name from assoc
当数组中只有一个值时,我会得到这个错误。
INVALID_FUNCTION_ARGUMENT: Array subscript out of bounds
如果只有一个值,我如何防止这个错误?
我正在使用jdbc连接到presto服务器。
从文档中,我能够连接到服务器并运行查询。
在连接/语句中发送ClientTags (X-Presto-Client-Tags)时,我遇到了一些问题。
下面是构建连接和运行查询的函数。
public void test() {
java.util.Properties info = new java.util.Properties();
if (PRESTO_USER != null) {
info.put("user", PRESTO_USER);
}
if (PRESTO_PASS
通过使用EMR上的presto-connector-mysql配置选项,我能够在EMR上创建一个名为mysql的目录。
但是,我想连接到多个mysql数据源。向/etc/presto/conf/catalog添加第二个数据源,然后执行restart presto-server是不完全正确的,因为虽然我可以正确地查询mysql数据源并显示第二个目录,但是在那里查询一个表会得到如下结果:
Query 20170407_040307_00008_qjgse failed: No nodes available to run query
有办法重置整个集群吗?是否需要在所有节点上安装新目录?