You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Alan Gates (JIRA)" <ji...@apache.org> on 2017/10/02 17:29:00 UTC

[jira] [Commented] (HIVE-17635) Add unit tests to CompactionTxnHandler and use PreparedStatements for queries

    [ https://issues.apache.org/jira/browse/HIVE-17635?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16188458#comment-16188458 ] 

Alan Gates commented on HIVE-17635:
-----------------------------------

Why is it better to use PreparedStatements in cases where the query is only executed once?  I buy it if you're preparing them and then storing them in a static cache somewhere, but since you're preparing them every time you run the query I don't see the advantage.

In CompactionTxnHandler, I don't think you want to remove the quoteString calls.  Those are to make it so that table or column names that are a keyword or contain spaces, etc. still work.  I don't think the PreparedStatement solves that.

Why the changes to CompactionTxnHandler but not TxnHandler?



> Add unit tests to CompactionTxnHandler and use PreparedStatements for queries
> -----------------------------------------------------------------------------
>
>                 Key: HIVE-17635
>                 URL: https://issues.apache.org/jira/browse/HIVE-17635
>             Project: Hive
>          Issue Type: Bug
>    Affects Versions: 3.0.0
>            Reporter: Andrew Sherman
>            Assignee: Andrew Sherman
>         Attachments: HIVE-17635.1.patch
>
>
> It is better for jdbc code that runs against the HMS database to use PreparedStatements. Convert CompactionTxnHandler queries to use PreparedStatement and add tests to TestCompactionTxnHandler to test these queries, and improve code coverage.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)