Search in sources :

Example 11 with FunctionCall

use of com.datastax.oss.dsbulk.mapping.FunctionCall in project dsbulk by datastax.

the class QueryInspectorTest method should_detect_function_select.

@Test
void should_detect_function_select() {
    QueryInspector inspector = new QueryInspector("SELECT myFunction(col1) as f1, \"MyFunction\"(\"My Col 2\") FROM ks.table1");
    CQLWord name1 = CQLWord.fromInternal("myfunction");
    CQLWord name2 = CQLWord.fromInternal("MyFunction");
    FunctionCall f1 = new FunctionCall(null, name1, COL_1);
    FunctionCall f2 = new FunctionCall(null, name2, MY_COL_2);
    assertThat(inspector.getResultSetVariables()).hasSize(2).containsKeys(f1, f2).containsValues(CQLWord.fromInternal("f1"), f2);
}
Also used : CQLWord(com.datastax.oss.dsbulk.mapping.CQLWord) FunctionCall(com.datastax.oss.dsbulk.mapping.FunctionCall) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Aggregations

FunctionCall (com.datastax.oss.dsbulk.mapping.FunctionCall)11 CQLFragment (com.datastax.oss.dsbulk.mapping.CQLFragment)7 CQLWord (com.datastax.oss.dsbulk.mapping.CQLWord)6 IndexedMappingField (com.datastax.oss.dsbulk.mapping.IndexedMappingField)5 MappedMappingField (com.datastax.oss.dsbulk.mapping.MappedMappingField)5 MappingField (com.datastax.oss.dsbulk.mapping.MappingField)5 ImmutableMultimap (com.datastax.oss.driver.shaded.guava.common.collect.ImmutableMultimap)4 ArrayList (java.util.ArrayList)4 CQLLiteral (com.datastax.oss.dsbulk.mapping.CQLLiteral)3 TypedCQLLiteral (com.datastax.oss.dsbulk.mapping.TypedCQLLiteral)3 Test (org.junit.jupiter.api.Test)3 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)3 DseEdgeMetadata (com.datastax.dse.driver.api.core.metadata.schema.DseEdgeMetadata)2 DseGraphKeyspaceMetadata (com.datastax.dse.driver.api.core.metadata.schema.DseGraphKeyspaceMetadata)2 DseGraphTableMetadata (com.datastax.dse.driver.api.core.metadata.schema.DseGraphTableMetadata)2 DseTableMetadata (com.datastax.dse.driver.api.core.metadata.schema.DseTableMetadata)2 DseVertexMetadata (com.datastax.dse.driver.api.core.metadata.schema.DseVertexMetadata)2 CqlIdentifier (com.datastax.oss.driver.api.core.CqlIdentifier)2 CqlSession (com.datastax.oss.driver.api.core.CqlSession)2 DefaultProtocolVersion (com.datastax.oss.driver.api.core.DefaultProtocolVersion)2