Purpose
To define an HCatalog server and the user information for connecting to it.
Format
/HCATCONNECTION service_url AUTHENTICATION authentication_option
connection_option ALIAS alias
Where
authentication_option | = | {DEFAULTSECURITY | KERBEROS} |
connection_option | = | USER username |
Arguments
service_url | The URL for the Hive database, in the form: http://<webhcat_server_name>:50111/templeton/v1/ddl/database/<db_name>, where <webhcat_server_name> is the webhcat server machine, and <db_name> is the name of the Hive database |
username | The username under which to connect to the Hive table when the authentication option is DEFAULTSECURITY. The username must be in the form of a string, which you can provide in any valid format. For a summary of valid naming and formatting conventions for identifiers and constants, see Syntax reference in the Connect help. |
alias | A name you assign to the hcatalog connection, which you will use to reference the connection in other options. The name assigned must adhere to the rules described for an identifier. For a summary of valid naming and formatting conventions for identifiers and constants, see Syntax reference in the Connect help. |
Location
The option may appear anywhere in the task definition.
Notes
You can use the connection in the /HCATINPUT or /HCATOUTPUT options to identify an HCatalog table source or target.
Authentication
Specify the authentication method that matches the cluster configuration; if they don’t match, the job will fail.
- If DEFAULTSECURITY is specified, a username must be provided. This is the default authentication method.
- If KERBEROS is specified, a username should not be provided, and an existing Kerberos ticket is used for authentication. The login user must be the same as the Kerberos principal, and the machine from which the connection is made must also be Kerberos protected.
Example
/HCATCONNECTION
http://hadoop-client.company.com:50111/templeton/v1/ddl/database/employee_db
USER "hcatuser" ALIAS hcat_emp_db
This option requests a connection to the Hive database employee_db as user
hcatuser. The authentication defaults to
DEFAULTSECURITY.
/HCATCONNECTION
http://hadoop-client.company.com:50111/templeton/v1/ddl/database/employee_db
AUTHENTICATION KERBEROS ALIAS hcat_emp_db
This option requests a connection to the Hive database employee_db using Kerberos authentication.