Member since
12-01-2017
5
Posts
0
Kudos Received
0
Solutions
07-17-2019
11:27 AM
Assuming you have the ODBC drivers installed the following should work. Another few notes, this is through Knox to LLAP. $s_ID = "youruser"
$s_PWD = "yourpassword"
$conn_string = "DRIVER={Hortonworks Hive ODBC Driver};ThriftTransport=2;SSL=1;Host=yourhost.com;Port=8443;Schema=yourdb;HiveServerType=2;AuthMech=3;HTTPPath=/gateway/default/llap;CAIssuedCertNamesMismatch=1;AllowSelfSignedServerCert=1;SSP_mapreduce.job.queuename=somequeue;SSP_tez.queue.name=somequeue;UseNativeQuery=1;UID=" + $s_ID + ";PWD=" + $s_PWD + ";"
$conn = New-Object System.Data.Odbc.OdbcConnection
$sql = "Show Tables"
$conn.ConnectionString = $conn_string
$conn.Open()
$cmd = New-Object System.Data.Odbc.OdbcCommand
$cmd.Connection = $conn
$cmd.CommandText = $sql
$execute = $cmd.ExecuteReader()
while ( $execute.read() )
{
$execute.GetValue(0)
}
... View more
12-04-2017
11:09 PM
I see. This is going to be inefficient, because Hive can't shuffle the data based on keys. You can do it like this probably: select ... from table_1, table_2 where fuzzy_match(column_x, column_y) (inner join branch) union all select ... from table_1 where not exists (select 1 from table_2 where fuzzy_match(column_x, column_y)) s1; (left outer branch) With this: https://issues.apache.org/jira/browse/HIVE-14731 you will at least not have single node cross products, but it will still be an expensive operation.
... View more