Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error querying 'Tuple' type #127

Closed
JavenJin opened this issue Apr 19, 2022 · 4 comments
Closed

Error querying 'Tuple' type #127

JavenJin opened this issue Apr 19, 2022 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@JavenJin
Copy link

I used Dbeaver to query my ClickHouse database and the following type of columns exist in a particular table.

dataType
 
Tuple(s String, i Int64)

When I query the table in my C# application I am prompted with the error.

System.ArgumentException: 'Unknown type: s String'

The code that went wrong is in the TypeConverter, as follows.

        internal static ClickHouseType ParseClickHouseType(SyntaxTreeNode node)
        {
            if (node.ChildNodes.Count == 0 && SimpleTypes.TryGetValue(node.Value, out var typeInfo))
            {
                return typeInfo;
            }

            if (ParameterizedTypes.ContainsKey(node.Value))
            {
                return ParameterizedTypes[node.Value].Parse(node, ParseClickHouseType);
            }

            throw new ArgumentException("Unknown type: " + node.ToString());
        }

Error when node.Value is equal to 's String'.

@JavenJin
Copy link
Author

@DarkWanderer

@DarkWanderer DarkWanderer added the bug Something isn't working label Apr 19, 2022
@DarkWanderer DarkWanderer self-assigned this Apr 19, 2022
@ChrisMcKee
Copy link

ChrisMcKee commented May 8, 2022

@jinwenjie98 what was the raw output from clickhouse that was being parsed?
(Probably also worth asking what version of clickhouse servers running too)

Testing it with multiple int types around the same output you've added above it seems to work as expected
https://github.com/ChrisMcKee/ClickHouse.Client/blob/82190307b0bddc4d4d2ea37388a730266de880bc/ClickHouse.Client.Tests/ADO/DataReaderTests.cs#L145-L166

@DarkWanderer DarkWanderer added investigation Additional investigation required and removed bug Something isn't working labels Jun 29, 2022
@DarkWanderer DarkWanderer added bug Something isn't working and removed investigation Additional investigation required labels Aug 2, 2022
@DarkWanderer
Copy link
Owner

Reproduces with latest ClickHouse in var schema = connection.GetSchema("Columns", new[] { "system" });

@DarkWanderer
Copy link
Owner

Fixed in 6.3.0, please comment/reopen if reoccurs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants