use of org.talend.components.snowflake.tsnowflakeoutput.TSnowflakeOutputProperties in project components by Talend.
the class SnowflakeRuntimeIT method handleRows.
protected Result handleRows(List<IndexedRecord> rows, SnowflakeConnectionTableProperties props, TSnowflakeOutputProperties.OutputAction action) throws Exception {
TSnowflakeOutputProperties handleProperties = getRightProperties(props);
handleProperties.outputAction.setValue(action);
LOGGER.debug(action + ": " + rows.size() + " rows");
return writeRows(makeWriter(handleProperties), rows);
}
use of org.talend.components.snowflake.tsnowflakeoutput.TSnowflakeOutputProperties in project components by Talend.
the class SnowflakeRuntimeIT method writeRows.
// Returns the rows written (having been re-read so they have their Ids)
protected List<IndexedRecord> writeRows(SnowflakeConnectionTableProperties props, List<IndexedRecord> outputRows) throws Exception {
TSnowflakeOutputProperties outputProps = getRightProperties(props);
outputProps.outputAction.setValue(TSnowflakeOutputProperties.OutputAction.INSERT);
writeRows(makeWriter(outputProps), outputRows);
return readAndCheckRows(props, outputRows.size());
}
use of org.talend.components.snowflake.tsnowflakeoutput.TSnowflakeOutputProperties in project components by Talend.
the class SnowflakeWritersTestIT method testOutputActionType.
@Test
public void testOutputActionType() throws Throwable {
ComponentDefinition definition = getComponentService().getComponentDefinition(TSnowflakeOutputDefinition.COMPONENT_NAME);
TSnowflakeOutputProperties outputProps = (TSnowflakeOutputProperties) getComponentService().getComponentProperties(TSnowflakeOutputDefinition.COMPONENT_NAME);
setupProps(outputProps.connection);
outputProps.outputAction.setValue(TSnowflakeOutputProperties.OutputAction.DELETE);
setupTableWithStaticValues(outputProps);
ComponentTestUtils.checkSerialize(outputProps, errorCollector);
List<IndexedRecord> rows = new ArrayList<>();
try {
writeRows(outputProps, rows);
} catch (Exception ex) {
if (ex instanceof ClassCastException) {
LOGGER.debug("Exception: " + ex.getMessage());
fail("Get error before delete!");
}
}
}
use of org.talend.components.snowflake.tsnowflakeoutput.TSnowflakeOutputProperties in project components by Talend.
the class SnowflakeWritersTestIT method testOutputBadConnection.
@Test
public void testOutputBadConnection() throws Throwable {
TSnowflakeOutputProperties outputProps = (TSnowflakeOutputProperties) getComponentService().getComponentProperties(TSnowflakeOutputDefinition.COMPONENT_NAME);
// No connection information
SnowflakeTableProperties tableProps = outputProps.table;
Form f = tableProps.getForm(Form.REFERENCE);
tableProps.tableName.setValue("BADONE");
tableProps = (SnowflakeTableProperties) PropertiesTestUtils.checkAndAfter(getComponentService(), f, tableProps.tableName.getName(), tableProps);
LOGGER.info(String.valueOf(tableProps.getValidationResult()));
assertEquals(ValidationResult.Result.ERROR, tableProps.getValidationResult().getStatus());
assertThat(tableProps.getValidationResult().getMessage(), containsString("Missing account"));
}
use of org.talend.components.snowflake.tsnowflakeoutput.TSnowflakeOutputProperties in project components by Talend.
the class SnowflakeResultListenerTest method setup.
@Before
public void setup() {
properties = new TSnowflakeOutputProperties("ouput");
properties.init();
listener = new SnowflakeResultListener(properties);
}
Aggregations