Search in sources :

Example 1 with HiveProperties

use of com.klarna.hiverunner.annotations.HiveProperties in project flink by apache.

the class FlinkEmbeddedHiveRunner method loadAnnotatedProperties.

private void loadAnnotatedProperties(Class testClass, HiveShellBuilder workFlowBuilder) {
    for (Field hivePropertyField : ReflectionUtils.getAllFields(testClass, withAnnotation(HiveProperties.class))) {
        Preconditions.checkState(ReflectionUtils.isOfType(hivePropertyField, Map.class), "Field annotated with @HiveProperties should be of type Map<String, String>");
        workFlowBuilder.putAllProperties(ReflectionUtils.getStaticFieldValue(testClass, hivePropertyField.getName(), Map.class));
    }
}
Also used : Field(java.lang.reflect.Field) HiveProperties(com.klarna.hiverunner.annotations.HiveProperties) Map(java.util.Map)

Aggregations

HiveProperties (com.klarna.hiverunner.annotations.HiveProperties)1 Field (java.lang.reflect.Field)1 Map (java.util.Map)1