calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Bateman <>
Subject CharSequence comparison
Date Tue, 08 Dec 2015 14:22:12 GMT

I have a row type object that has a CharSequence member called "name". It
turns out I can't compare this with a "string" or character array in a SQL

For instance: "SELECT * FROM <table> WHERE name = 'FOO'"


Cannot apply '=' to arguments of type '<JAVATYPE(INTERFACE
JAVA.LANG.CHARSEQUENCE)> = <CHAR(3)>'. Supported form(s):

I think I get the issue, that CharSequence does not implement "Comparable".
So I'm out of luck there.

Then I figured I could create a function to convert a CharSequence into a
character array or a string.

So I have this:

import org.apache.calcite.linq4j.function.Function1;

public class CharSequenceToCharArrayFunction implements
Function1<CharSequence, char[]> {

    public CharSequenceToCharArrayFunction() {

    public char[] apply(CharSequence str) {
        return str.toString().toCharArray();


However, when I try it complains:

No match found for function signature seqToChar(<JavaType(interface

My schema definition:

"version": "1.0",
"defaultSchema": "USERS",
            "name": "USERS",
            "type": "custom",
            "factory": "",
                "directory": "/tmp"

                    "name": "seqToChar",
                    "methodName": "apply"

Any insight?

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message