APISonar


org.datavec.api.transform.ColumnType.Time

> org > datavec > api > transform > ColumnType > Time
org APIs datavec APIs api APIs transform APIs ColumnType APIs Time APIs

Example 1
public void setInputSchema(Schema schema) {
        if (!(schema instanceof SequenceSchema))
            throw new IllegalArgumentException(
                            "Invalid schema: OverlappingTimeWindowFunction can only operate on SequenceSchema");
        if (!schema.hasColumn(timeColumn))
            throw new IllegalStateException("Input schema does not have a column with name \"" + timeColumn + "\"");

        if (schema.getMetaData(timeColumn).getColumnType() != ColumnType.Time)
            throw new IllegalStateException("Invalid column: column \"" + timeColumn + "\" is not of type "
                            + ColumnType.Time + "; is " + schema.getMetaData(timeColumn).getColumnType());

        this.inputSchema = schema;

        timeZone = ((TimeMetaData) schema.getMetaData(timeColumn)).getTimeZone();
    }
Example 2
public void testNullWritableColumnCondition() {
        Schema schema = TestTransforms.getSchema(ColumnType.Time);

        Condition condition = new NullWritableColumnCondition("column");
        condition.setInputSchema(schema);

        assertTrue(condition.condition(Collections.singletonList((Writable) NullWritable.INSTANCE)));
        assertTrue(condition.condition(Collections.singletonList((Writable) new NullWritable())));
        assertFalse(condition.condition(Collections.singletonList((Writable) new IntWritable(0))));
        assertFalse(condition.condition(Collections.singletonList((Writable) new Text("1"))));
    }