close
Skip to content

More sensible handling of selecting camelcase columns #13649

@TheBuilderJR

Description

@TheBuilderJR

Describe the bug

If I run the following query

SELECT userId FROM telemetry_user_events LIMIT 10;

against a table with the following schema


New Query
{
    "fields": [
        {
            "name": "event",
            "data_type": "Utf8",
            "nullable": true,
            "dict_id": 0,
            "dict_is_ordered": false,
            "metadata": {}
        },
        {
            "name": "prompt",
            "data_type": "Utf8",
            "nullable": true,
            "dict_id": 0,
            "dict_is_ordered": false,
            "metadata": {}
        },
        {
            "name": "timestamp",
            "data_type": "Utf8",
            "nullable": true,
            "dict_id": 0,
            "dict_is_ordered": false,
            "metadata": {}
        },
        {
            "name": "timestamp_utc",
            "data_type": {
                "Timestamp": [
                    "Millisecond",
                    "UTC"
                ]
            },
            "nullable": true,
            "dict_id": 0,
            "dict_is_ordered": false,
            "metadata": {}
        },
        {
            "name": "teamId",
            "data_type": "Utf8",
            "nullable": true,
            "dict_id": 0,
            "dict_is_ordered": false,
            "metadata": {}
        },
        {
            "name": "userId",
            "data_type": "Utf8",
            "nullable": true,
            "dict_id": 0,
            "dict_is_ordered": false,
            "metadata": {}
        },
        {
            "name": "query",
            "data_type": "Utf8",
            "nullable": true,
            "dict_id": 0,
            "dict_is_ordered": false,
            "metadata": {}
        }
    ],
    "metadata": {}
}

I get the following error

Schema error: No field named userid. Valid fields are telemetry_user_events.event, telemetry_user_events.prompt, telemetry_user_events.timestamp, telemetry_user_events.timestamp_utc, telemetry_user_events.\"teamId\", telemetry_user_events.\"userId\", telemetry_user_events.query.\n 1: No field named userid. Valid fields are telemetry_user_events.event, telemetry_user_events.prompt, telemetry_user_events.timestamp, telemetry_user_events.timestamp_utc, telemetry_user_events.\"teamId\", telemetry_user_events.\"userId\", telemetry_user_events.query.

However if I wrap userId in quotes like so

SELECT "userId" FROM telemetry_user_events LIMIT 10;

there are no errors. but this seems unideal! all other sql query engines I know handle camelcase gracefully

To Reproduce

Included in the above

Expected behavior

no errors if i select a camelcase column without wrapping in quotes

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions