- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
ResultSet
非常耗时。每个批处理调用似乎几乎需要 60 秒,这很可疑(可能是由于超时造成的?)。我正在使用 Java JDBC Presto 驱动程序对 Presto 执行一个简单的查询,其本质上如下所示:
SELECT stringA, stringB
FROM {table}
LIMIT 500000
stringA
和 stringB
很小 - 每个大约 10 个字符。
当使用 teradata 驱动程序在 DbVisualizer 中运行时,我的查询在 10 秒内完成。
但是,当我使用 0.230 presto-jdbc 驱动程序从 Spring Java 应用程序运行相同的查询时,似乎会批量返回结果(大约 75,000 个),并且每个批处理需要一分钟多的时间才能返回。
我已经阅读了一些有关 Presto 的 targetResultSize
查询参数的内容,但我无法使用 JDBC 驱动程序/连接来设置它。我读过 presto 默认情况下一次只会返回 1MB 的数据?不确定这是否是我上述问题 #1 的原因 - 如果能弄清楚如何配置它,那就太好了。
public List<Object> getResultSetUsingDriverManager(ChronoLocalDate chronoLocalDate) throws SQLException {
long start = System.currentTimeMillis();
Properties properties = new Properties();
properties.setProperty("user", USERNAME);
properties.setProperty("password", PASSWORD);
properties.setProperty("SSL", "true");
final Connection connection = DriverManager.getConnection(URL, properties);
log.warn("Presto connection acquired in " + (System.currentTimeMillis() - start) + "ms");
Statement statement = connection.createStatement();
ResultSet resultSet = statement.executeQuery(query);
log.warn("Presto query executed in " + (System.currentTimeMillis() - start) + "ms");
List<Object> collection = new ArrayList<>();
int counter = 0;
long batchStart = System.currentTimeMillis();
while (resultSet.next()) {
counter++;
if (counter % 1000 == 0) {
log.warn("current count {} and took {}ms", counter, (System.currentTimeMillis() - batchStart));
batchStart = System.currentTimeMillis();
}
}
log.warn("Results extracted in " + (System.currentTimeMillis() - start));
return collection;
}
2020-01-08 17:34:31.704 WARN 29368 --- ... : Presto connection acquired in 0ms
2020-01-08 17:35:16.705 WARN 29368 --- ... : Presto query executed in 45003ms
2020-01-08 17:37:18.242 WARN 29368 --- ... : current count 1000 and took 121537ms
2020-01-08 17:37:18.244 WARN 29368 --- ... : current count 2000 and took 2ms
2020-01-08 17:37:18.245 WARN 29368 --- ... : current count 3000 and took 1ms
...
2020-01-08 17:37:18.294 WARN 29368 --- ... : current count 75000 and took 1ms
2020-01-08 17:38:18.857 WARN 29368 --- ... : current count 76000 and took 60563ms
2020-01-08 17:38:18.858 WARN 29368 --- ... : current count 77000 and took 1ms
...
2020-01-08 17:38:18.941 WARN 29368 --- ... : current count 151000 and took 0ms
2020-01-08 17:39:19.241 WARN 29368 --- ... : current count 152000 and took 60300ms
2020-01-08 17:39:19.242 WARN 29368 --- ... : current count 153000 and took 1ms
...
2020-01-08 17:39:19.311 WARN 29368 --- ... : current count 250000 and took 0ms
2020-01-08 17:39:19.311 WARN 29368 --- ... : Results extracted in 287609
最佳答案
近几个月来,我们修复了与 Java 11 上的客户端连接相关的问题。
请将您的 JDBC 驱动程序升级到 327。
或者在客户端降级到 Java 8。
关于java - Presto JDBC 大型查询极慢,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59656252/
是否有任何选项可以在 Presto CLI 上提供参数。 我正在尝试将我的 impala-shell 命令更改为 Presto,其中我的 HQL 文件从 impala 的命令行获取参数,如下所示。 i
默认情况下,Presto 执行区分大小写的分组依据。但我想知道如何进行不区分大小写的分组。一种方法是将列中的所有东西都转换为小写,然后进行group by ie select * from ( sel
我怀疑答案是“视情况而定”,但是否有关于计划用于 Presto 的硬件类型的一般指导? 由于 Presto 使用一个协调器和一组工作器,并且工作器使用数据运行,我想主要问题将是协调器有足够的 RAM,
Presto 有多个 connectors 。虽然连接器确实实现了读写操作,但从我读过的所有教程来看,它们似乎通常用作仅读取的数据源。例如,netflix 在 Amazon S3 上有“10 PB”的
Postgres 有: SELECT VERSION(); 什么是 Presto 等价物? 我已经看过 Presto docs ,但无法找到等价物。 最佳答案 你试过下面的吗? SELECT node
Presto 支持哪些文件格式?是否有推荐的特定文件格式以获得更好的性能。我很想知道是否有像 RCfile 这样针对 Presto 进行优化的柱状文件格式? 最佳答案 我们测试每个 Trino (fo
我目前正在使用 Presto 0.80。我必须编写一个用户定义的函数来在选择查询期间将摄氏度转换为华氏度。我使用 Hive QL 做了同样的事情,但想知道我们是否可以在 Facebook Presto
我想获得所有连接的工作人员的列表,以便我可以检测哪个工作人员不工作。 我试过 select * from sys.node;但它不起作用。 我正在使用 Presto 0.128。 最佳答案 对于 0.
我是 Presto 的新手,无法弄清楚如何检查 map 中是否存在 key 。当我运行 SELECT查询,返回此错误信息: Key not present in map: element SELECT
我的数据如下所述 customer_id usage_month usage_by_product usage 1 June {"A":5
我的问题有点类似于这个( Athena/Presto - UNNEST MAP to columns )。但就我而言,我事先知道我需要哪些列。 我的用例是这样的 我有一个 json blob,其中包含
如何在 Presto 中创建一个表,其中其中一列具有数组数据类型? 例如: 如果不存在则创建表(ID BIGINT、ARRAY_COL 数组)... 最佳答案 编辑 数组类型的语法为array(ele
我的问题有点类似于这个( Athena/Presto - UNNEST MAP to columns )。但就我而言,我事先知道我需要哪些列。 我的用例是这样的 我有一个 json blob,其中包含
使用 Impala 运行 CDH4 集群,我创建了 parquet 表并在 adding 之后parquet jar 文件到 hive,我可以使用 hive 查询表。 将相同的 jar 集添加到/op
我将为这个站点做一个简化的例子,但基本上我正在尝试编写一个 Athena 查询(由 Glue 爬虫加载的数据,意图在 Quicksight 中使用),这将允许我在 select 语句中扩展一个结构。
我尝试运行启动器但遇到此错误: Exception in thread "main" java.lang.UnsupportedClassVersionError: sun/misc/Floating
我看到明确的要求,要构建 presto,您需要 Mac OS/Linux。 https://github.com/prestodb/presto我还看到正在讨论有关为 Presto 构建提供 Wind
我有以下查询,其中 shopname 存储为 varbinary 而不是 varchar 类型。 select shopname, itemname from shop_profile where c
能够设置脚本变量非常方便。例如, SET start_date = 20151201; SELECT * FROM some_table where date = {$hiveconf:start_d
我在 Presto 教程上看到了这个,它说好处是“在数据存在的地方查询数据”。 这是什么意思?我喜欢与事物的传统 v. Presto 版本进行比较。 编辑:通过链接到主页上的引用来添加上下文 http
我是一名优秀的程序员,十分优秀!