public interface HiveOperations
HiveTemplate
.
Not often used directly, but a useful option to enhance testability, as it can easily be mocked or stubbed.Modifier and Type | Method and Description |
---|---|
<T> T |
execute(HiveClientCallback<T> action)
Executes the action specified by the given callback object within an active
HiveClient . |
java.util.List<java.lang.String> |
executeScript(HiveScript script)
Executes a Hive script.
|
java.util.List<java.lang.String> |
executeScript(java.lang.Iterable<HiveScript> scripts)
Executes multiple Hive scripts.
|
java.util.List<java.lang.String> |
query(java.lang.String query)
Executes the given HiveQL that results in a list of objects.
|
java.util.List<java.lang.String> |
query(java.lang.String query,
java.util.Map<?,?> arguments)
Executes the given HiveQL using the list of arguments, expecting a list of objects.
|
java.lang.Integer |
queryForInt(java.lang.String query)
Executes the given HiveQL that results in a single int value.
|
java.lang.Integer |
queryForInt(java.lang.String query,
java.util.Map<?,?> arguments)
Executes the given HiveQL using the list of arguments, that results in a single int value.
|
java.lang.Long |
queryForLong(java.lang.String query)
Executes the given HiveQL that results in a single long value.
|
java.lang.Long |
queryForLong(java.lang.String query,
java.util.Map<?,?> arguments)
Executes the given HiveQL using the list of arguments, that results in a single long value.
|
java.lang.String |
queryForString(java.lang.String query)
Executes the given HiveQL that results in a single object.
|
java.lang.String |
queryForString(java.lang.String query,
java.util.Map<?,?> arguments)
Executes the given HiveQL using the list of arguments, that results in a single object.
|
<T> T execute(HiveClientCallback<T> action) throws org.springframework.dao.DataAccessException
HiveClient
.T
- action typeaction
- callback object taht specifies the Hive actionorg.springframework.dao.DataAccessException
- exceptionjava.util.List<java.lang.String> query(java.lang.String query) throws org.springframework.dao.DataAccessException
query
- HiveQLorg.springframework.dao.DataAccessException
- exceptionjava.util.List<java.lang.String> query(java.lang.String query, java.util.Map<?,?> arguments) throws org.springframework.dao.DataAccessException
query
- HiveQLarguments
- query argumentsorg.springframework.dao.DataAccessException
- exceptionjava.lang.String queryForString(java.lang.String query) throws org.springframework.dao.DataAccessException
query
- HiveQLorg.springframework.dao.DataAccessException
- exceptionjava.lang.String queryForString(java.lang.String query, java.util.Map<?,?> arguments) throws org.springframework.dao.DataAccessException
query
- HiveQLarguments
- query argumentsorg.springframework.dao.DataAccessException
- exceptionjava.lang.Integer queryForInt(java.lang.String query) throws org.springframework.dao.DataAccessException
query
- HiveQLorg.springframework.dao.DataAccessException
- exceptionjava.lang.Integer queryForInt(java.lang.String query, java.util.Map<?,?> arguments) throws org.springframework.dao.DataAccessException
query
- HiveQLarguments
- query argumentsorg.springframework.dao.DataAccessException
- exceptionjava.lang.Long queryForLong(java.lang.String query) throws org.springframework.dao.DataAccessException
query
- HiveQLorg.springframework.dao.DataAccessException
- exceptionjava.lang.Long queryForLong(java.lang.String query, java.util.Map<?,?> arguments) throws org.springframework.dao.DataAccessException
query
- HiveQLarguments
- query argumentsorg.springframework.dao.DataAccessException
- exceptionjava.util.List<java.lang.String> executeScript(HiveScript script) throws org.springframework.dao.DataAccessException
script
- script resource and argumentsorg.springframework.dao.DataAccessException
- exceptionjava.util.List<java.lang.String> executeScript(java.lang.Iterable<HiveScript> scripts) throws org.springframework.dao.DataAccessException
scripts
- script resources and argumentsorg.springframework.dao.DataAccessException
- exception