Skip to content

ESQL: Make there be one commonType #112167

@nik9000

Description

@nik9000

Description

There are currently three methods called commonType:

  • EsqlDataTypeRegistry.INSTANCE.commonType
  • EsqlDataTypeConverter.commonType
  • DataTypeConverter.commonType

These seem to exist because we were inheriting from QL's common infrastructure. But we're not any more so we can collapse these.

Also! There are clauses in DataTypeConverter.commonType that don't feel like they make sense in ESQL - or maybe they do, but I don't understand them. We seem to promote keyword to text and strings to numerics. We also have this which feels redundant:

        if (isDateTime(left) && isDateTime(right)) {
            return DATETIME;
        }

It'd be lovely if someone could flatten these into one call and remove the clauses that don't apply to ESQL.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions