在Apache Drill上有“autotrace traceonly”的替代方案吗?

时间:2016-02-05 09:45:11

标签: sql sqlplus apache-drill

我是Apache Drill的新手。

出于性能测试的目的,我正在尝试测量执行查询的时间。而且我也不需要打印已执行的结果。

在Oracle SQL Plus中,有[{ "categoryImage": "https://www.winni.in/assets/img/app/city-home/cake.jpg", "categoryName": "cakes", "categoryId": 4 }, { "categoryImage": "https://www.winni.in/assets/img/app/city-home/flowers.jpg", "categoryName": "flowers-and-bouquets", "categoryId": 12 }, { "categoryImage": "https://www.winni.in/assets/img/app/city-home/chocolates.jpg", "categoryName": "chocolates-for-all", "categoryId": 63 }, { "categoryImage": "https://www.winni.in/assets/img/app/city-home/mugs.jpg", "categoryName": "Mugs", "categoryId": 34 }, { "categoryImage": "https://www.winni.in/assets/img/app/city-home/figurines.jpg", "categoryName": "figurines", "categoryId": 84 }, { "categoryImage": "https://www.winni.in/assets/img/app/city-home/giftframes.jpg", "categoryName": "gift-and-photo-frames", "categoryId": 106 }, { "categoryImage": "https://www.winni.in/assets/img/app/city-home/greetingcards.jpg", "categoryName": "greeting-cards", "categoryId": 103 }, { "categoryImage": "https://www.winni.in/assets/img/app/city-home/handicrafts.jpg", "categoryName": "handicrafts", "categoryId": 44 }, { "categoryImage": "https://www.winni.in/assets/img/app/city-home/penstands.jpg", "categoryName": "pen-stands", "categoryId": 142 }, { "categoryImage": "https://www.winni.in/assets/img/app/city-home/combos.jpg", "categoryName": "gift-combos", "categoryId": 99 }, { "categoryImage": "https://www.winni.in/assets/img/app/city-home/softtoys.jpg", "categoryName": "soft-toys", "categoryId": 104 }, { "categoryImage": "https://www.winni.in/assets/img/app/city-home/diecasttoys.jpg", "categoryName": "diecast-toys", "categoryId": 138 }, { "categoryImage": "https://www.winni.in/assets/img/app/city-home/jewellery.jpg", "categoryName": "jewellery", "categoryId": 41 }, { "categoryImage": "https://www.winni.in/assets/img/app/city-home/clocks.jpg", "categoryName": "clocks", "categoryId": 137 }, { "categoryImage": "https://www.winni.in/assets/img/app/city-home/crystalgifts.jpg", "categoryName": "crystal gifts", "categoryId": 136 }, { "categoryImage": "https://www.winni.in/assets/img/app/city-home/lamps.jpg", "categoryName": "lamps", "categoryId": 97 }, { "categoryImage": "https://www.winni.in/assets/img/app/city-home/slambook.jpg", "categoryName": "slambook", "categoryId": 139 }] 。此设置功能如下(引自oracle web site):

  

与SET AUTOTRACE ON类似,但禁止打印用户的查询输出(如果有)。如果启用了STATISTICS,则仍会提取查询数据,但不会打印。

在Apache Drill的sqlline中,我收到如下错误:set autotrace traceonly

您对替代品有什么想法吗?

谢谢,

P.S。

我也读过这个回答的问题。 Any command in mysql equivalent to Oracle's autotrace for performance turning 不幸的是,它不适用于Apache Drill。

1 个答案:

答案 0 :(得分:1)

您可以将查询放在文本文件(例如query.sql)中,然后运行sqlline并将输出转发到/ dev / null:

bin/sqlline -u jdbc:drill:zk=localhost:2181 -f query.sql > /dev/null

它仍会显示一些数据,但只显示最小值:

1/1          select * from cp.`employee.json`;
1,155 rows selected (0.65 seconds)
Closing: org.apache.drill.jdbc.impl.DrillConnectionImpl
apache drill 1.4.0 
"say hello to my little drill"