[ https://issues.apache.org/jira/browse/CASSANDRA-14127?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
FAGIM SADYKOV updated CASSANDRA-14127: -------------------------------------- Description: Try to create UDF {code:java} CREATE OR REPLACE FUNCTION max_x_plus_y (input set<frozen<some_record>>) CALLED ON NULL INPUT RETURNS some_record LANGUAGE java AS ' return Collections.max(input, new Comparator<UDTValue>() { @Override public int compare(UDTValue first, UDTValue second) { int firstsum = first.getInt("x")+first.getInt("y"); int secondsum = second.getInt("x")+second.getInt("y"); return Integer.compare(firstsum,secondsum); } }); '; {code} I got error: {code:log} com.datastax.driver.core.exceptions.InvalidQueryException: Java source compilation failed: GENERATED SOURCE ERROR: line 1 (in generated source): The type java.util.function.ToLongFunction cannot be resolved. It is indirectly referenced from required .class files GENERATED SOURCE ERROR: line 1 (in generated source): The type java.util.function.ToIntFunction cannot be resolved. It is indirectly referenced from required .class files GENERATED SOURCE ERROR: line 1 (in generated source): The type java.util.function.ToDoubleFunction cannot be resolved. It is indirectly referenced from required .class files GENERATED SOURCE ERROR: line 1 (in generated source): The type java.util.function.Function cannot be resolved. It is indirectly referenced from required .class files {code} was: Try to create UDF ``` CREATE OR REPLACE FUNCTION max_x_plus_y (input set<frozen<some_record>>) CALLED ON NULL INPUT RETURNS some_record LANGUAGE java AS ' return Collections.max(input, new Comparator<UDTValue>() { @Override public int compare(UDTValue first, UDTValue second) { int firstsum = first.getInt("x")+first.getInt("y"); int secondsum = second.getInt("x")+second.getInt("y"); return Integer.compare(firstsum,secondsum); } }); '; ``` I got error: ``` com.datastax.driver.core.exceptions.InvalidQueryException: Java source compilation failed: GENERATED SOURCE ERROR: line 1 (in generated source): The type java.util.function.ToLongFunction cannot be resolved. It is indirectly referenced from required .class files GENERATED SOURCE ERROR: line 1 (in generated source): The type java.util.function.ToIntFunction cannot be resolved. It is indirectly referenced from required .class files GENERATED SOURCE ERROR: line 1 (in generated source): The type java.util.function.ToDoubleFunction cannot be resolved. It is indirectly referenced from required .class files GENERATED SOURCE ERROR: line 1 (in generated source): The type java.util.function.Function cannot be resolved. It is indirectly referenced from required .class files ``` > Cannot use UDTValue in UDF > -------------------------- > > Key: CASSANDRA-14127 > URL: https://issues.apache.org/jira/browse/CASSANDRA-14127 > Project: Cassandra > Issue Type: Bug > Components: CQL > Reporter: FAGIM SADYKOV > Fix For: 3.11.x > > > Try to create UDF > {code:java} > CREATE OR REPLACE FUNCTION max_x_plus_y (input set<frozen<some_record>>) > CALLED ON NULL INPUT RETURNS some_record > LANGUAGE java AS ' > return Collections.max(input, new Comparator<UDTValue>() { > @Override > public int compare(UDTValue first, UDTValue second) { > int firstsum = first.getInt("x")+first.getInt("y"); > int secondsum = second.getInt("x")+second.getInt("y"); > return Integer.compare(firstsum,secondsum); > } > }); > '; > {code} > I got error: > {code:log} > com.datastax.driver.core.exceptions.InvalidQueryException: Java source > compilation failed: > GENERATED SOURCE ERROR: line 1 (in generated source): The type > java.util.function.ToLongFunction cannot be resolved. It is indirectly > referenced from required .class files > GENERATED SOURCE ERROR: line 1 (in generated source): The type > java.util.function.ToIntFunction cannot be resolved. It is indirectly > referenced from required .class files > GENERATED SOURCE ERROR: line 1 (in generated source): The type > java.util.function.ToDoubleFunction cannot be resolved. It is indirectly > referenced from required .class files > GENERATED SOURCE ERROR: line 1 (in generated source): The type > java.util.function.Function cannot be resolved. It is indirectly referenced > from required .class files > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org