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

Sergio Peña commented on HIVE-13964:
------------------------------------

Thanks [~ayousufi]. This time it works fine.

I was running some tests, but I don't find the properties needed to make it 
work.

1. Using an empty properties file
{noformat}
$ beeline --property-file /tmp/props
Property "url" is required
$ 
{noformat}

2. Passing URL through command line and a properties file
{noformat}
$ beeline -u jdbc:hive2://localhost:10000 --property-file=/tmp/props
Connecting to jdbc:hive2://localhost:10000
Connected to: Apache Hive (version 2.2.0-SNAPSHOT)
Driver: Hive JDBC (version 2.2.0-SNAPSHOT)
16/06/13 10:44:01 [main]: WARN jdbc.HiveConnection: Request to set autoCommit 
to false; Hive does not support autoCommit=false.
Transaction isolation: TRANSACTION_REPEATABLE_READ
Property "url" is required
Closing: 0: jdbc:hive2://localhost:10000
$
{noformat}

3. Adding 'url' to properties file
{noformat}
$ echo "url=jdbc:hive2://localhost:10000" > /tmp/props
$ beeline --property-file /tmp/props
Connecting to jdbc:hive2://localhost:10000
java.lang.NullPointerException
$
{noformat}

I'm not sure how this properties file should work on beeline. 
- Is 'url' needed even if I pass '-u' through cmdline? If both are the same, I 
think we should take cmdline to connect first, then use the one in props.
- what is the 'url' value passed to props? why is there a NPE?

I imagine props file is just an optional file that can be used to pass other 
hive properties that users usually set dynamically through beeline command 
line, such as:
{noformat}
$ cat /tmp/props
hive.default.fileformat=ORC
{noformat}

Could you make sure that --property-file works as expected?

> Add a parameter to beeline to allow a properties file to be passed in
> ---------------------------------------------------------------------
>
>                 Key: HIVE-13964
>                 URL: https://issues.apache.org/jira/browse/HIVE-13964
>             Project: Hive
>          Issue Type: New Feature
>          Components: Beeline
>    Affects Versions: 2.0.1
>            Reporter: Abdullah Yousufi
>            Assignee: Abdullah Yousufi
>            Priority: Minor
>             Fix For: 2.2.0
>
>         Attachments: HIVE-13964.01.patch, HIVE-13964.02.patch, 
> HIVE-13964.03.patch
>
>
> HIVE-6652 removed the ability to pass in a properties file as a beeline 
> parameter. It may be a useful feature to be able to pass the file in is a 
> parameter, such as --property-file.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to