Wednesday 15 June 2022

Execute hive command in non-interactive mode

Syntax

hive -e {command_to_execute}

 

Above statement launch hive, execute the statement and quit.

 

Example

hive -e "show tables"

$hive -e "show tables"
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/Cellar/hive/3.1.2_2/libexec/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/Cellar/hadoop/3.3.0/libexec/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Hive Session ID = a9528dab-b167-478d-b629-6582b3d0c59b

Logging initialized using configuration in jar:file:/usr/local/Cellar/hive/3.1.2_2/libexec/lib/hive-common-3.1.2.jar!/hive-log4j2.properties Async: true
Hive Session ID = 37bc3631-ceb7-459b-ae5d-572846c86a8a
OK
Time taken: 1.085 seconds

 

 

 

Previous                                                    Next                                                    Home

No comments:

Post a Comment