[jira] [Commented] (HIVE-20552) Get Schema from LogicalPlan faster
[ https://issues.apache.org/jira/browse/HIVE-20552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16721318#comment-16721318 ] Teddy Choi commented on HIVE-20552: --- I will fix the bugs in HIVE-21041. > Get Schema from LogicalPlan faster > -- > > Key: HIVE-20552 > URL: https://issues.apache.org/jira/browse/HIVE-20552 > Project: Hive > Issue Type: Improvement >Reporter: Teddy Choi >Assignee: Teddy Choi >Priority: Major > Labels: pull-request-available > Fix For: 4.0.0, 3.2.0 > > Attachments: HIVE-20552.1.patch, HIVE-20552.2.patch, > HIVE-20552.3.patch > > > To get the schema of a query faster, it currently needs to compile, optimize, > and generate a TezPlan, which creates extra overhead when only the > LogicalPlan is needed. > 1. Copy the method \{{HiveMaterializedViewsRegistry.parseQuery}}, making it > \{{public static}} and putting it in a utility class. > 2. Change the return statement of the method to \{{return > analyzer.getResultSchema();}} > 3. Change the return type of the method to \{{List}} > 4. Call the new method from \{{GenericUDTFGetSplits.createPlanFragment}} > replacing the current code which does this: > {code} > if(num == 0) { > //Schema only > return new PlanFragment(null, schema, null); > } > {code} > moving the call earlier in \{{getPlanFragment}} ... right after the HiveConf > is created ... bypassing the code that uses \{{HiveTxnManager}} and > \{{Driver}}. > 5. Convert the \{{List}} to > \{{org.apache.hadoop.hive.llap.Schema}}. > 6. return from \{{getPlanFragment}} by returning \{{new PlanFragment(null, > schema, null)}} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (HIVE-20552) Get Schema from LogicalPlan faster
[ https://issues.apache.org/jira/browse/HIVE-20552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16631280#comment-16631280 ] Teddy Choi commented on HIVE-20552: --- [~jcamachorodriguez], thanks! Pushed to master. > Get Schema from LogicalPlan faster > -- > > Key: HIVE-20552 > URL: https://issues.apache.org/jira/browse/HIVE-20552 > Project: Hive > Issue Type: Improvement >Reporter: Teddy Choi >Assignee: Teddy Choi >Priority: Major > Labels: pull-request-available > Attachments: HIVE-20552.1.patch, HIVE-20552.2.patch, > HIVE-20552.3.patch > > > To get the schema of a query faster, it currently needs to compile, optimize, > and generate a TezPlan, which creates extra overhead when only the > LogicalPlan is needed. > 1. Copy the method \{{HiveMaterializedViewsRegistry.parseQuery}}, making it > \{{public static}} and putting it in a utility class. > 2. Change the return statement of the method to \{{return > analyzer.getResultSchema();}} > 3. Change the return type of the method to \{{List}} > 4. Call the new method from \{{GenericUDTFGetSplits.createPlanFragment}} > replacing the current code which does this: > {code} > if(num == 0) { > //Schema only > return new PlanFragment(null, schema, null); > } > {code} > moving the call earlier in \{{getPlanFragment}} ... right after the HiveConf > is created ... bypassing the code that uses \{{HiveTxnManager}} and > \{{Driver}}. > 5. Convert the \{{List}} to > \{{org.apache.hadoop.hive.llap.Schema}}. > 6. return from \{{getPlanFragment}} by returning \{{new PlanFragment(null, > schema, null)}} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (HIVE-20552) Get Schema from LogicalPlan faster
[ https://issues.apache.org/jira/browse/HIVE-20552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16631126#comment-16631126 ] Jesus Camacho Rodriguez commented on HIVE-20552: +1 > Get Schema from LogicalPlan faster > -- > > Key: HIVE-20552 > URL: https://issues.apache.org/jira/browse/HIVE-20552 > Project: Hive > Issue Type: Improvement >Reporter: Teddy Choi >Assignee: Teddy Choi >Priority: Major > Labels: pull-request-available > Attachments: HIVE-20552.1.patch, HIVE-20552.2.patch, > HIVE-20552.3.patch > > > To get the schema of a query faster, it currently needs to compile, optimize, > and generate a TezPlan, which creates extra overhead when only the > LogicalPlan is needed. > 1. Copy the method \{{HiveMaterializedViewsRegistry.parseQuery}}, making it > \{{public static}} and putting it in a utility class. > 2. Change the return statement of the method to \{{return > analyzer.getResultSchema();}} > 3. Change the return type of the method to \{{List}} > 4. Call the new method from \{{GenericUDTFGetSplits.createPlanFragment}} > replacing the current code which does this: > {code} > if(num == 0) { > //Schema only > return new PlanFragment(null, schema, null); > } > {code} > moving the call earlier in \{{getPlanFragment}} ... right after the HiveConf > is created ... bypassing the code that uses \{{HiveTxnManager}} and > \{{Driver}}. > 5. Convert the \{{List}} to > \{{org.apache.hadoop.hive.llap.Schema}}. > 6. return from \{{getPlanFragment}} by returning \{{new PlanFragment(null, > schema, null)}} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (HIVE-20552) Get Schema from LogicalPlan faster
[ https://issues.apache.org/jira/browse/HIVE-20552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16621176#comment-16621176 ] Hive QA commented on HIVE-20552: Here are the results of testing the latest attachment: https://issues.apache.org/jira/secure/attachment/12940382/HIVE-20552.3.patch {color:red}ERROR:{color} -1 due to no test(s) being added or modified. {color:green}SUCCESS:{color} +1 due to 14981 tests passed Test results: https://builds.apache.org/job/PreCommit-HIVE-Build/13912/testReport Console output: https://builds.apache.org/job/PreCommit-HIVE-Build/13912/console Test logs: http://104.198.109.242/logs/PreCommit-HIVE-Build-13912/ Messages: {noformat} Executing org.apache.hive.ptest.execution.TestCheckPhase Executing org.apache.hive.ptest.execution.PrepPhase Executing org.apache.hive.ptest.execution.YetusPhase Executing org.apache.hive.ptest.execution.ExecutionPhase Executing org.apache.hive.ptest.execution.ReportingPhase {noformat} This message is automatically generated. ATTACHMENT ID: 12940382 - PreCommit-HIVE-Build > Get Schema from LogicalPlan faster > -- > > Key: HIVE-20552 > URL: https://issues.apache.org/jira/browse/HIVE-20552 > Project: Hive > Issue Type: Improvement >Reporter: Teddy Choi >Assignee: Teddy Choi >Priority: Major > Labels: pull-request-available > Attachments: HIVE-20552.1.patch, HIVE-20552.2.patch, > HIVE-20552.3.patch > > > To get the schema of a query faster, it currently needs to compile, optimize, > and generate a TezPlan, which creates extra overhead when only the > LogicalPlan is needed. > 1. Copy the method \{{HiveMaterializedViewsRegistry.parseQuery}}, making it > \{{public static}} and putting it in a utility class. > 2. Change the return statement of the method to \{{return > analyzer.getResultSchema();}} > 3. Change the return type of the method to \{{List}} > 4. Call the new method from \{{GenericUDTFGetSplits.createPlanFragment}} > replacing the current code which does this: > {code} > if(num == 0) { > //Schema only > return new PlanFragment(null, schema, null); > } > {code} > moving the call earlier in \{{getPlanFragment}} ... right after the HiveConf > is created ... bypassing the code that uses \{{HiveTxnManager}} and > \{{Driver}}. > 5. Convert the \{{List}} to > \{{org.apache.hadoop.hive.llap.Schema}}. > 6. return from \{{getPlanFragment}} by returning \{{new PlanFragment(null, > schema, null)}} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (HIVE-20552) Get Schema from LogicalPlan faster
[ https://issues.apache.org/jira/browse/HIVE-20552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16621120#comment-16621120 ] Hive QA commented on HIVE-20552: | (/) *{color:green}+1 overall{color}* | \\ \\ || Vote || Subsystem || Runtime || Comment || || || || || {color:brown} Prechecks {color} || | {color:green}+1{color} | {color:green} @author {color} | {color:green} 0m 0s{color} | {color:green} The patch does not contain any @author tags. {color} | || || || || {color:brown} master Compile Tests {color} || | {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 8m 25s{color} | {color:green} master passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 1m 4s{color} | {color:green} master passed {color} | | {color:green}+1{color} | {color:green} checkstyle {color} | {color:green} 0m 43s{color} | {color:green} master passed {color} | | {color:blue}0{color} | {color:blue} findbugs {color} | {color:blue} 4m 4s{color} | {color:blue} ql in master has 2326 extant Findbugs warnings. {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 57s{color} | {color:green} master passed {color} | || || || || {color:brown} Patch Compile Tests {color} || | {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 1m 25s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 1m 8s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} javac {color} | {color:green} 1m 8s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} checkstyle {color} | {color:green} 0m 44s{color} | {color:green} ql: The patch generated 0 new + 300 unchanged - 3 fixed = 300 total (was 303) {color} | | {color:green}+1{color} | {color:green} whitespace {color} | {color:green} 0m 0s{color} | {color:green} The patch has no whitespace issues. {color} | | {color:green}+1{color} | {color:green} findbugs {color} | {color:green} 4m 19s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 58s{color} | {color:green} the patch passed {color} | || || || || {color:brown} Other Tests {color} || | {color:green}+1{color} | {color:green} asflicense {color} | {color:green} 0m 13s{color} | {color:green} The patch does not generate ASF License warnings. {color} | | {color:black}{color} | {color:black} {color} | {color:black} 24m 38s{color} | {color:black} {color} | \\ \\ || Subsystem || Report/Notes || | Optional Tests | asflicense javac javadoc findbugs checkstyle compile | | uname | Linux hiveptest-server-upstream 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u1 (2016-09-03) x86_64 GNU/Linux | | Build tool | maven | | Personality | /data/hiveptest/working/yetus_PreCommit-HIVE-Build-13912/dev-support/hive-personality.sh | | git revision | master / 487714a | | Default Java | 1.8.0_111 | | findbugs | v3.0.0 | | modules | C: ql U: ql | | Console output | http://104.198.109.242/logs//PreCommit-HIVE-Build-13912/yetus.txt | | Powered by | Apache Yetushttp://yetus.apache.org | This message was automatically generated. > Get Schema from LogicalPlan faster > -- > > Key: HIVE-20552 > URL: https://issues.apache.org/jira/browse/HIVE-20552 > Project: Hive > Issue Type: Improvement >Reporter: Teddy Choi >Assignee: Teddy Choi >Priority: Major > Labels: pull-request-available > Attachments: HIVE-20552.1.patch, HIVE-20552.2.patch, > HIVE-20552.3.patch > > > To get the schema of a query faster, it currently needs to compile, optimize, > and generate a TezPlan, which creates extra overhead when only the > LogicalPlan is needed. > 1. Copy the method \{{HiveMaterializedViewsRegistry.parseQuery}}, making it > \{{public static}} and putting it in a utility class. > 2. Change the return statement of the method to \{{return > analyzer.getResultSchema();}} > 3. Change the return type of the method to \{{List}} > 4. Call the new method from \{{GenericUDTFGetSplits.createPlanFragment}} > replacing the current code which does this: > {code} > if(num == 0) { > //Schema only > return new PlanFragment(null, schema, null); > } > {code} > moving the call earlier in \{{getPlanFragment}} ... right after the HiveConf > is created ... bypassing the code that uses \{{HiveTxnManager}} and > \{{Driver}}. > 5. Convert the \{{List}} to > \{{org.apache.hadoop.hive.llap.Schema}}. > 6. return from \{{getPlanFragment}} by returning \{{new PlanFragment(null, > schema, null)}} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (HIVE-20552) Get Schema from LogicalPlan faster
[ https://issues.apache.org/jira/browse/HIVE-20552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16614486#comment-16614486 ] Hive QA commented on HIVE-20552: Here are the results of testing the latest attachment: https://issues.apache.org/jira/secure/attachment/12939550/HIVE-20552.2.patch {color:red}ERROR:{color} -1 due to build exiting with an error Test results: https://builds.apache.org/job/PreCommit-HIVE-Build/13775/testReport Console output: https://builds.apache.org/job/PreCommit-HIVE-Build/13775/console Test logs: http://104.198.109.242/logs/PreCommit-HIVE-Build-13775/ Messages: {noformat} Executing org.apache.hive.ptest.execution.TestCheckPhase Tests exited with: Exception: Patch URL https://issues.apache.org/jira/secure/attachment/12939550/HIVE-20552.2.patch was found in seen patch url's cache and a test was probably run already on it. Aborting... {noformat} This message is automatically generated. ATTACHMENT ID: 12939550 - PreCommit-HIVE-Build > Get Schema from LogicalPlan faster > -- > > Key: HIVE-20552 > URL: https://issues.apache.org/jira/browse/HIVE-20552 > Project: Hive > Issue Type: Improvement >Reporter: Teddy Choi >Assignee: Teddy Choi >Priority: Major > Labels: pull-request-available > Attachments: HIVE-20552.1.patch, HIVE-20552.2.patch > > > To get the schema of a query faster, it currently needs to compile, optimize, > and generate a TezPlan, which creates extra overhead when only the > LogicalPlan is needed. > 1. Copy the method \{{HiveMaterializedViewsRegistry.parseQuery}}, making it > \{{public static}} and putting it in a utility class. > 2. Change the return statement of the method to \{{return > analyzer.getResultSchema();}} > 3. Change the return type of the method to \{{List}} > 4. Call the new method from \{{GenericUDTFGetSplits.createPlanFragment}} > replacing the current code which does this: > {code} > if(num == 0) { > //Schema only > return new PlanFragment(null, schema, null); > } > {code} > moving the call earlier in \{{getPlanFragment}} ... right after the HiveConf > is created ... bypassing the code that uses \{{HiveTxnManager}} and > \{{Driver}}. > 5. Convert the \{{List}} to > \{{org.apache.hadoop.hive.llap.Schema}}. > 6. return from \{{getPlanFragment}} by returning \{{new PlanFragment(null, > schema, null)}} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (HIVE-20552) Get Schema from LogicalPlan faster
[ https://issues.apache.org/jira/browse/HIVE-20552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16614293#comment-16614293 ] Hive QA commented on HIVE-20552: Here are the results of testing the latest attachment: https://issues.apache.org/jira/secure/attachment/12939550/HIVE-20552.2.patch {color:red}ERROR:{color} -1 due to no test(s) being added or modified. {color:green}SUCCESS:{color} +1 due to 14939 tests passed Test results: https://builds.apache.org/job/PreCommit-HIVE-Build/13768/testReport Console output: https://builds.apache.org/job/PreCommit-HIVE-Build/13768/console Test logs: http://104.198.109.242/logs/PreCommit-HIVE-Build-13768/ Messages: {noformat} Executing org.apache.hive.ptest.execution.TestCheckPhase Executing org.apache.hive.ptest.execution.PrepPhase Executing org.apache.hive.ptest.execution.YetusPhase Executing org.apache.hive.ptest.execution.ExecutionPhase Executing org.apache.hive.ptest.execution.ReportingPhase {noformat} This message is automatically generated. ATTACHMENT ID: 12939550 - PreCommit-HIVE-Build > Get Schema from LogicalPlan faster > -- > > Key: HIVE-20552 > URL: https://issues.apache.org/jira/browse/HIVE-20552 > Project: Hive > Issue Type: Improvement >Reporter: Teddy Choi >Assignee: Teddy Choi >Priority: Major > Labels: pull-request-available > Attachments: HIVE-20552.1.patch, HIVE-20552.2.patch > > > To get the schema of a query faster, it currently needs to compile, optimize, > and generate a TezPlan, which creates extra overhead when only the > LogicalPlan is needed. > 1. Copy the method \{{HiveMaterializedViewsRegistry.parseQuery}}, making it > \{{public static}} and putting it in a utility class. > 2. Change the return statement of the method to \{{return > analyzer.getResultSchema();}} > 3. Change the return type of the method to \{{List}} > 4. Call the new method from \{{GenericUDTFGetSplits.createPlanFragment}} > replacing the current code which does this: > {code} > if(num == 0) { > //Schema only > return new PlanFragment(null, schema, null); > } > {code} > moving the call earlier in \{{getPlanFragment}} ... right after the HiveConf > is created ... bypassing the code that uses \{{HiveTxnManager}} and > \{{Driver}}. > 5. Convert the \{{List}} to > \{{org.apache.hadoop.hive.llap.Schema}}. > 6. return from \{{getPlanFragment}} by returning \{{new PlanFragment(null, > schema, null)}} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (HIVE-20552) Get Schema from LogicalPlan faster
[ https://issues.apache.org/jira/browse/HIVE-20552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16614260#comment-16614260 ] Hive QA commented on HIVE-20552: | (x) *{color:red}-1 overall{color}* | \\ \\ || Vote || Subsystem || Runtime || Comment || || || || || {color:brown} Prechecks {color} || | {color:green}+1{color} | {color:green} @author {color} | {color:green} 0m 0s{color} | {color:green} The patch does not contain any @author tags. {color} | || || || || {color:brown} master Compile Tests {color} || | {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 8m 38s{color} | {color:green} master passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 1m 8s{color} | {color:green} master passed {color} | | {color:green}+1{color} | {color:green} checkstyle {color} | {color:green} 0m 41s{color} | {color:green} master passed {color} | | {color:blue}0{color} | {color:blue} findbugs {color} | {color:blue} 4m 3s{color} | {color:blue} ql in master has 2311 extant Findbugs warnings. {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 59s{color} | {color:green} master passed {color} | || || || || {color:brown} Patch Compile Tests {color} || | {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 1m 25s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 1m 5s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} javac {color} | {color:green} 1m 5s{color} | {color:green} the patch passed {color} | | {color:red}-1{color} | {color:red} checkstyle {color} | {color:red} 0m 39s{color} | {color:red} ql: The patch generated 1 new + 22 unchanged - 1 fixed = 23 total (was 23) {color} | | {color:green}+1{color} | {color:green} whitespace {color} | {color:green} 0m 0s{color} | {color:green} The patch has no whitespace issues. {color} | | {color:green}+1{color} | {color:green} findbugs {color} | {color:green} 4m 12s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 1m 0s{color} | {color:green} the patch passed {color} | || || || || {color:brown} Other Tests {color} || | {color:green}+1{color} | {color:green} asflicense {color} | {color:green} 0m 14s{color} | {color:green} The patch does not generate ASF License warnings. {color} | | {color:black}{color} | {color:black} {color} | {color:black} 24m 33s{color} | {color:black} {color} | \\ \\ || Subsystem || Report/Notes || | Optional Tests | asflicense javac javadoc findbugs checkstyle compile | | uname | Linux hiveptest-server-upstream 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u1 (2016-09-03) x86_64 GNU/Linux | | Build tool | maven | | Personality | /data/hiveptest/working/yetus_PreCommit-HIVE-Build-13768/dev-support/hive-personality.sh | | git revision | master / 35f86c7 | | Default Java | 1.8.0_111 | | findbugs | v3.0.0 | | checkstyle | http://104.198.109.242/logs//PreCommit-HIVE-Build-13768/yetus/diff-checkstyle-ql.txt | | modules | C: ql U: ql | | Console output | http://104.198.109.242/logs//PreCommit-HIVE-Build-13768/yetus.txt | | Powered by | Apache Yetushttp://yetus.apache.org | This message was automatically generated. > Get Schema from LogicalPlan faster > -- > > Key: HIVE-20552 > URL: https://issues.apache.org/jira/browse/HIVE-20552 > Project: Hive > Issue Type: Improvement >Reporter: Teddy Choi >Assignee: Teddy Choi >Priority: Major > Labels: pull-request-available > Attachments: HIVE-20552.1.patch, HIVE-20552.2.patch > > > To get the schema of a query faster, it currently needs to compile, optimize, > and generate a TezPlan, which creates extra overhead when only the > LogicalPlan is needed. > 1. Copy the method \{{HiveMaterializedViewsRegistry.parseQuery}}, making it > \{{public static}} and putting it in a utility class. > 2. Change the return statement of the method to \{{return > analyzer.getResultSchema();}} > 3. Change the return type of the method to \{{List}} > 4. Call the new method from \{{GenericUDTFGetSplits.createPlanFragment}} > replacing the current code which does this: > {code} > if(num == 0) { > //Schema only > return new PlanFragment(null, schema, null); > } > {code} > moving the call earlier in \{{getPlanFragment}} ... right after the HiveConf > is created ... bypassing the code that uses \{{HiveTxnManager}} and > \{{Driver}}. > 5. Convert the \{{List}} to > \{{org.apache.hadoop.hive.llap.Schema}}. > 6. return from \{{getPlanFragment}} by returning \{{new PlanFragment(null, > schema, null)}} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (HIVE-20552) Get Schema from LogicalPlan faster
[ https://issues.apache.org/jira/browse/HIVE-20552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16614194#comment-16614194 ] Jesus Camacho Rodriguez commented on HIVE-20552: [~teddy.choi], can you move the static methods from HiveMaterializedViewsRegistry to one of the Hive utility classes, e.g., ParseUtils? It does not seem right that GenericUDTFGetSplits needs to call HiveMaterializedViewsRegistry. Thanks > Get Schema from LogicalPlan faster > -- > > Key: HIVE-20552 > URL: https://issues.apache.org/jira/browse/HIVE-20552 > Project: Hive > Issue Type: Improvement >Reporter: Teddy Choi >Assignee: Teddy Choi >Priority: Major > Labels: pull-request-available > Attachments: HIVE-20552.1.patch, HIVE-20552.2.patch > > > To get the schema of a query faster, it currently needs to compile, optimize, > and generate a TezPlan, which creates extra overhead when only the > LogicalPlan is needed. > 1. Copy the method \{{HiveMaterializedViewsRegistry.parseQuery}}, making it > \{{public static}} and putting it in a utility class. > 2. Change the return statement of the method to \{{return > analyzer.getResultSchema();}} > 3. Change the return type of the method to \{{List}} > 4. Call the new method from \{{GenericUDTFGetSplits.createPlanFragment}} > replacing the current code which does this: > {code} > if(num == 0) { > //Schema only > return new PlanFragment(null, schema, null); > } > {code} > moving the call earlier in \{{getPlanFragment}} ... right after the HiveConf > is created ... bypassing the code that uses \{{HiveTxnManager}} and > \{{Driver}}. > 5. Convert the \{{List}} to > \{{org.apache.hadoop.hive.llap.Schema}}. > 6. return from \{{getPlanFragment}} by returning \{{new PlanFragment(null, > schema, null)}} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (HIVE-20552) Get Schema from LogicalPlan faster
[ https://issues.apache.org/jira/browse/HIVE-20552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16613398#comment-16613398 ] Teddy Choi commented on HIVE-20552: --- Thanks, [~kgyrtkirk]. I applied all of your feedbacks. > Get Schema from LogicalPlan faster > -- > > Key: HIVE-20552 > URL: https://issues.apache.org/jira/browse/HIVE-20552 > Project: Hive > Issue Type: Improvement >Reporter: Teddy Choi >Assignee: Teddy Choi >Priority: Major > Labels: pull-request-available > Attachments: HIVE-20552.1.patch, HIVE-20552.2.patch > > > To get the schema of a query faster, it currently needs to compile, optimize, > and generate a TezPlan, which creates extra overhead when only the > LogicalPlan is needed. > 1. Copy the method \{{HiveMaterializedViewsRegistry.parseQuery}}, making it > \{{public static}} and putting it in a utility class. > 2. Change the return statement of the method to \{{return > analyzer.getResultSchema();}} > 3. Change the return type of the method to \{{List}} > 4. Call the new method from \{{GenericUDTFGetSplits.createPlanFragment}} > replacing the current code which does this: > {code} > if(num == 0) { > //Schema only > return new PlanFragment(null, schema, null); > } > {code} > moving the call earlier in \{{getPlanFragment}} ... right after the HiveConf > is created ... bypassing the code that uses \{{HiveTxnManager}} and > \{{Driver}}. > 5. Convert the \{{List}} to > \{{org.apache.hadoop.hive.llap.Schema}}. > 6. return from \{{getPlanFragment}} by returning \{{new PlanFragment(null, > schema, null)}} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (HIVE-20552) Get Schema from LogicalPlan faster
[ https://issues.apache.org/jira/browse/HIVE-20552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16613143#comment-16613143 ] Zoltan Haindrich commented on HIVE-20552: - I think it would be better not duplicating that method - but please change the log message to something more connected to what actually happening ; I think in case an exception is happening there - there is not much use of returning null - because that will just cause some npe later on - I would recommend to throw an exception.. > Get Schema from LogicalPlan faster > -- > > Key: HIVE-20552 > URL: https://issues.apache.org/jira/browse/HIVE-20552 > Project: Hive > Issue Type: Improvement >Reporter: Teddy Choi >Assignee: Teddy Choi >Priority: Major > Labels: pull-request-available > Attachments: HIVE-20552.1.patch > > > To get the schema of a query faster, it currently needs to compile, optimize, > and generate a TezPlan, which creates extra overhead when only the > LogicalPlan is needed. > 1. Copy the method \{{HiveMaterializedViewsRegistry.parseQuery}}, making it > \{{public static}} and putting it in a utility class. > 2. Change the return statement of the method to \{{return > analyzer.getResultSchema();}} > 3. Change the return type of the method to \{{List}} > 4. Call the new method from \{{GenericUDTFGetSplits.createPlanFragment}} > replacing the current code which does this: > {code} > if(num == 0) { > //Schema only > return new PlanFragment(null, schema, null); > } > {code} > moving the call earlier in \{{getPlanFragment}} ... right after the HiveConf > is created ... bypassing the code that uses \{{HiveTxnManager}} and > \{{Driver}}. > 5. Convert the \{{List}} to > \{{org.apache.hadoop.hive.llap.Schema}}. > 6. return from \{{getPlanFragment}} by returning \{{new PlanFragment(null, > schema, null)}} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (HIVE-20552) Get Schema from LogicalPlan faster
[ https://issues.apache.org/jira/browse/HIVE-20552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16613131#comment-16613131 ] ASF GitHub Bot commented on HIVE-20552: --- GitHub user pudidic opened a pull request: https://github.com/apache/hive/pull/433 HIVE-20552: Get Schema from LogicalPlan for HWC (Teddy Choi) You can merge this pull request into a Git repository by running: $ git pull https://github.com/pudidic/hive HIVE-20552 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/hive/pull/433.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #433 commit aa51cf24ccfafc61b01b96bd261e315e9d973c8d Author: Teddy Choi Date: 2018-09-13T07:26:16Z HIVE-20552: Get Schema from LogicalPlan for HWC (Teddy Choi) > Get Schema from LogicalPlan faster > -- > > Key: HIVE-20552 > URL: https://issues.apache.org/jira/browse/HIVE-20552 > Project: Hive > Issue Type: Improvement >Reporter: Teddy Choi >Assignee: Teddy Choi >Priority: Major > Labels: pull-request-available > Attachments: HIVE-20552.1.patch > > > To get the schema of a query faster, it currently needs to compile, optimize, > and generate a TezPlan, which creates extra overhead when only the > LogicalPlan is needed. > 1. Copy the method \{{HiveMaterializedViewsRegistry.parseQuery}}, making it > \{{public static}} and putting it in a utility class. > 2. Change the return statement of the method to \{{return > analyzer.getResultSchema();}} > 3. Change the return type of the method to \{{List}} > 4. Call the new method from \{{GenericUDTFGetSplits.createPlanFragment}} > replacing the current code which does this: > {code} > if(num == 0) { > //Schema only > return new PlanFragment(null, schema, null); > } > {code} > moving the call earlier in \{{getPlanFragment}} ... right after the HiveConf > is created ... bypassing the code that uses \{{HiveTxnManager}} and > \{{Driver}}. > 5. Convert the \{{List}} to > \{{org.apache.hadoop.hive.llap.Schema}}. > 6. return from \{{getPlanFragment}} by returning \{{new PlanFragment(null, > schema, null)}} -- This message was sent by Atlassian JIRA (v7.6.3#76005)