[jira] [Commented] (DRILL-7037) Apache Drill Crashes when a 50mb json string is queried via the REST API provided
[ https://issues.apache.org/jira/browse/DRILL-7037?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16816675#comment-16816675 ] Venkata Jyothsna Donapati commented on DRILL-7037: -- [~er.ayushsha...@gmail.com] Drill provides a way to create temporary tables. Please take a look at [this|[https://drill.apache.org/docs/create-temporary-table-as-cttas/]] > Apache Drill Crashes when a 50mb json string is queried via the REST API > provided > - > > Key: DRILL-7037 > URL: https://issues.apache.org/jira/browse/DRILL-7037 > Project: Apache Drill > Issue Type: Bug > Components: Client - HTTP >Affects Versions: 1.14.0 > Environment: Windows 10 > 24GB RAM > 8 Cores > Used the REST API call to query drill >Reporter: Ayush Sharma >Priority: Blocker > > Apache Drill crashes with OutofMemoryException (24GB RAM) when a REST API > call is made by supplying a json of size 50MB in the query paramater of the > REST API. > The REST API even crashes for a 10MB query (16GB RAM) and works with a 5MB > query. > This is a blocker for us and will need immediate remediation. > We are also not aware of any sys.options which might bring the HEAP size down > drastically or currently making it go up. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (DRILL-7037) Apache Drill Crashes when a 50mb json string is queried via the REST API provided
[ https://issues.apache.org/jira/browse/DRILL-7037?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16780127#comment-16780127 ] Ayush Sharma commented on DRILL-7037: - [~kkhatua] Are temporary tables provided by Drill or i need to use my own database? In case its my own database the read and write time would be higher than normal disk read write which i am using as a workaround for now. However security is not liking the fact that we are writing data into the disk even though we delete it post querying. > Apache Drill Crashes when a 50mb json string is queried via the REST API > provided > - > > Key: DRILL-7037 > URL: https://issues.apache.org/jira/browse/DRILL-7037 > Project: Apache Drill > Issue Type: Bug > Components: Client - HTTP >Affects Versions: 1.14.0 > Environment: Windows 10 > 24GB RAM > 8 Cores > Used the REST API call to query drill >Reporter: Ayush Sharma >Priority: Blocker > > Apache Drill crashes with OutofMemoryException (24GB RAM) when a REST API > call is made by supplying a json of size 50MB in the query paramater of the > REST API. > The REST API even crashes for a 10MB query (16GB RAM) and works with a 5MB > query. > This is a blocker for us and will need immediate remediation. > We are also not aware of any sys.options which might bring the HEAP size down > drastically or currently making it go up. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (DRILL-7037) Apache Drill Crashes when a 50mb json string is queried via the REST API provided
[ https://issues.apache.org/jira/browse/DRILL-7037?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16779911#comment-16779911 ] Kunal Khatua commented on DRILL-7037: - [~er.ayushsha...@gmail.com] one possible workaround would be to use temporary tables to dump your JSON data into and then work off that, since you mentioned that it works when querying the JSON file directly. In the event of a crash or end of session, the data would be deleted as it is temporary in nature. > Apache Drill Crashes when a 50mb json string is queried via the REST API > provided > - > > Key: DRILL-7037 > URL: https://issues.apache.org/jira/browse/DRILL-7037 > Project: Apache Drill > Issue Type: Bug > Components: Client - HTTP >Affects Versions: 1.14.0 > Environment: Windows 10 > 24GB RAM > 8 Cores > Used the REST API call to query drill >Reporter: Ayush Sharma >Priority: Blocker > > Apache Drill crashes with OutofMemoryException (24GB RAM) when a REST API > call is made by supplying a json of size 50MB in the query paramater of the > REST API. > The REST API even crashes for a 10MB query (16GB RAM) and works with a 5MB > query. > This is a blocker for us and will need immediate remediation. > We are also not aware of any sys.options which might bring the HEAP size down > drastically or currently making it go up. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (DRILL-7037) Apache Drill Crashes when a 50mb json string is queried via the REST API provided
[ https://issues.apache.org/jira/browse/DRILL-7037?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16767174#comment-16767174 ] Vitalii Diravka commented on DRILL-7037: [~er.ayushsha...@gmail.com] Thanks for the stack trace. It clearly shows that issue come from the Calcite. Drill can't build the plan for this huge query. Calcite HEP planner creates a big DAG with a RelNode vertices. It uses DEPTH_FIRST algorithm to apply different rules for optimization and then recursively process children to obtain the best logical plan. And HEAP memory is used for that whole process. Calcite is a SQL planner for many engines. Therefore looks like it should be solved in Calcite project. You can ask Calcite [community|https://calcite.apache.org/community/#help] about it and then [create ticket |https://issues.apache.org/jira/projects/CALCITE]. > Apache Drill Crashes when a 50mb json string is queried via the REST API > provided > - > > Key: DRILL-7037 > URL: https://issues.apache.org/jira/browse/DRILL-7037 > Project: Apache Drill > Issue Type: Bug > Components: Client - HTTP >Affects Versions: 1.14.0 > Environment: Windows 10 > 24GB RAM > 8 Cores > Used the REST API call to query drill >Reporter: Ayush Sharma >Priority: Blocker > > Apache Drill crashes with OutofMemoryException (24GB RAM) when a REST API > call is made by supplying a json of size 50MB in the query paramater of the > REST API. > The REST API even crashes for a 10MB query (16GB RAM) and works with a 5MB > query. > This is a blocker for us and will need immediate remediation. > We are also not aware of any sys.options which might bring the HEAP size down > drastically or currently making it go up. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (DRILL-7037) Apache Drill Crashes when a 50mb json string is queried via the REST API provided
[ https://issues.apache.org/jira/browse/DRILL-7037?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16766837#comment-16766837 ] Ayush Sharma commented on DRILL-7037: - [~priteshm] [~vitalii] Please find the details below: Request Body : {\"queryType\" : \"SQL\",\"query\" : \"**QUERY**"} *'QUERY'* - select e.* from (select FLATTEN(t.jdata) from ((select convert_from('<*our json*>','json') as jdata) UNION ALL (select convert_from('<*our json*>','json') as jdata)) t) e *'our json' -* Because of the string limit we are appending the query one by one to be within the string limit imposed by Drill on command line or REST Call (Not sure of the exact value , approx 2 chars) Please do let me know if you need anything else to debug the issue. *Out of Memory Exception:* {code:java} // Catastrophic failure occurred. Exiting. Information follows: Unable to handle out of memory condition in Foreman. java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Arrays.java:3332) at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:124) at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:448) at java.lang.StringBuffer.append(StringBuffer.java:270) at java.io.StringWriter.write(StringWriter.java:112) at java.io.PrintWriter.write(PrintWriter.java:456) at java.io.PrintWriter.write(PrintWriter.java:473) at org.apache.calcite.rel.AbstractRelNode$1.explain_(AbstractRelNode.java:415) at org.apache.calcite.rel.externalize.RelWriterImpl.done(RelWriterImpl.java:156) at org.apache.calcite.rel.AbstractRelNode.explain(AbstractRelNode.java:314) at org.apache.calcite.rel.AbstractRelNode.computeDigest(AbstractRelNode.java:422) at org.apache.calcite.rel.AbstractRelNode.recomputeDigest(AbstractRelNode.java:358) at org.apache.calcite.rel.core.SetOp.replaceInput(SetOp.java:89) at org.apache.calcite.plan.hep.HepPlanner.buildFinalPlan(HepPlanner.java:878) at org.apache.calcite.plan.hep.HepPlanner.buildFinalPlan(HepPlanner.java:877) at org.apache.calcite.plan.hep.HepPlanner.buildFinalPlan(HepPlanner.java:877) at org.apache.calcite.plan.hep.HepPlanner.buildFinalPlan(HepPlanner.java:877) at org.apache.calcite.plan.hep.HepPlanner.buildFinalPlan(HepPlanner.java:877) at org.apache.calcite.plan.hep.HepPlanner.buildFinalPlan(HepPlanner.java:877) at org.apache.calcite.plan.hep.HepPlanner.buildFinalPlan(HepPlanner.java:877) at org.apache.calcite.plan.hep.HepPlanner.buildFinalPlan(HepPlanner.java:877) at org.apache.calcite.plan.hep.HepPlanner.buildFinalPlan(HepPlanner.java:877) at org.apache.calcite.plan.hep.HepPlanner.buildFinalPlan(HepPlanner.java:877) at org.apache.calcite.plan.hep.HepPlanner.buildFinalPlan(HepPlanner.java:877) at org.apache.calcite.plan.hep.HepPlanner.buildFinalPlan(HepPlanner.java:877) at org.apache.calcite.plan.hep.HepPlanner.buildFinalPlan(HepPlanner.java:877) at org.apache.calcite.plan.hep.HepPlanner.buildFinalPlan(HepPlanner.java:877) at org.apache.calcite.plan.hep.HepPlanner.buildFinalPlan(HepPlanner.java:877) at org.apache.calcite.plan.hep.HepPlanner.buildFinalPlan(HepPlanner.java:877) at org.apache.calcite.plan.hep.HepPlanner.buildFinalPlan(HepPlanner.java:877) at org.apache.calcite.plan.hep.HepPlanner.buildFinalPlan(HepPlanner.java:877) at org.apache.calcite.plan.hep.HepPlanner.buildFinalPlan(HepPlanner.java:877) {code} > Apache Drill Crashes when a 50mb json string is queried via the REST API > provided > - > > Key: DRILL-7037 > URL: https://issues.apache.org/jira/browse/DRILL-7037 > Project: Apache Drill > Issue Type: Bug > Components: Client - HTTP >Affects Versions: 1.14.0 > Environment: Windows 10 > 24GB RAM > 8 Cores > Used the REST API call to query drill >Reporter: Ayush Sharma >Priority: Blocker > > Apache Drill crashes with OutofMemoryException (24GB RAM) when a REST API > call is made by supplying a json of size 50MB in the query paramater of the > REST API. > The REST API even crashes for a 10MB query (16GB RAM) and works with a 5MB > query. > This is a blocker for us and will need immediate remediation. > We are also not aware of any sys.options which might bring the HEAP size down > drastically or currently making it go up. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (DRILL-7037) Apache Drill Crashes when a 50mb json string is queried via the REST API provided
[ https://issues.apache.org/jira/browse/DRILL-7037?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16766258#comment-16766258 ] Pritesh Maker commented on DRILL-7037: -- [~er.ayushsha...@gmail.com] please do share any logs/ stack traces as [~vitalii] suggested. I do want to understand the use case and the scenario better - when you say that you are supplying a 50MB JSON query parameter, can you give an example of the REST API Call, the query and the parameter value? This will help us analyze potential code paths that could be impacted. > Apache Drill Crashes when a 50mb json string is queried via the REST API > provided > - > > Key: DRILL-7037 > URL: https://issues.apache.org/jira/browse/DRILL-7037 > Project: Apache Drill > Issue Type: Bug > Components: Client - HTTP >Affects Versions: 1.14.0 > Environment: Windows 10 > 24GB RAM > 8 Cores > Used the REST API call to query drill >Reporter: Ayush Sharma >Priority: Blocker > Attachments: scheduler.txt > > > Apache Drill crashes with OutofMemoryException (24GB RAM) when a REST API > call is made by supplying a json of size 50MB in the query paramater of the > REST API. > The REST API even crashes for a 10MB query (16GB RAM) and works with a 5MB > query. > This is a blocker for us and will need immediate remediation. > We are also not aware of any sys.options which might bring the HEAP size down > drastically or currently making it go up. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (DRILL-7037) Apache Drill Crashes when a 50mb json string is queried via the REST API provided
[ https://issues.apache.org/jira/browse/DRILL-7037?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16766130#comment-16766130 ] Ayush Sharma commented on DRILL-7037: - The query works fine if used via JSON file , however that raises security concerns for us as it is not secure in our project to use Disk space for storing files (Also deleting is a concern in case our application crashes in worst case scenario). Also the query fails with sqlLine and JDBC client too (Crashes while still running the planner). Would like to understand what made Drill use this huge memory. It will be a change in our architecture and we would have to search for an alternative if Drill doesn't work with REST API call. So i am really looking forward to a solution to this as it will be a big overhead to move away from this tool. > Apache Drill Crashes when a 50mb json string is queried via the REST API > provided > - > > Key: DRILL-7037 > URL: https://issues.apache.org/jira/browse/DRILL-7037 > Project: Apache Drill > Issue Type: Bug > Components: Client - HTTP >Affects Versions: 1.14.0 > Environment: Windows 10 > 24GB RAM > 8 Cores > Used the REST API call to query drill >Reporter: Ayush Sharma >Priority: Blocker > Attachments: scheduler.txt > > > Apache Drill crashes with OutofMemoryException (24GB RAM) when a REST API > call is made by supplying a json of size 50MB in the query paramater of the > REST API. > The REST API even crashes for a 10MB query (16GB RAM) and works with a 5MB > query. > This is a blocker for us and will need immediate remediation. > We are also not aware of any sys.options which might bring the HEAP size down > drastically or currently making it go up. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (DRILL-7037) Apache Drill Crashes when a 50mb json string is queried via the REST API provided
[ https://issues.apache.org/jira/browse/DRILL-7037?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16766058#comment-16766058 ] Vitalii Diravka commented on DRILL-7037: [~er.ayushsha...@gmail.com] Thank you for reporting the issue for this interesting case. Could you please provide logs and query profile? Did you try the same query from the JDBC client or Drill SqlLine? You can store your query to the script file and run it with -f or --run, see https://drill.apache.org/docs/configuring-the-drill-shell/#sqlline-connection-parameters Did you check the heap dump after OOM? Did you try to perform the same query from the JSON file? > Apache Drill Crashes when a 50mb json string is queried via the REST API > provided > - > > Key: DRILL-7037 > URL: https://issues.apache.org/jira/browse/DRILL-7037 > Project: Apache Drill > Issue Type: Bug > Components: Client - HTTP >Affects Versions: 1.14.0 > Environment: Windows 10 > 24GB RAM > 8 Cores > Used the REST API call to query drill >Reporter: Ayush Sharma >Priority: Blocker > Attachments: scheduler.txt > > > Apache Drill crashes with OutofMemoryException (24GB RAM) when a REST API > call is made by supplying a json of size 50MB in the query paramater of the > REST API. > The REST API even crashes for a 10MB query (16GB RAM) and works with a 5MB > query. > This is a blocker for us and will need immediate remediation. > We are also not aware of any sys.options which might bring the HEAP size down > drastically or currently making it go up. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)