Giter Site home page Giter Site logo

Comments (6)

AlexAkulov avatar AlexAkulov commented on July 2, 2024

Thank you!
Please try with v0.4.2.
I've fixed this issue just now.

from clickhouse-backup.

Hackintosh-Unix avatar Hackintosh-Unix commented on July 2, 2024

It works! Thank you!

from clickhouse-backup.

nahwinrajan avatar nahwinrajan commented on July 2, 2024

So what is the issue ?

I am currently encountering this whilst running clickhouse-client from the official docker image.
I've created some comparable Create Table instead my actual, but it have the some structure.

I am trying to make table where it is ordered by, fields in the nested field.:

CREATE TABLE SOME_RAW_TABLE (
  team Nested (
    teamID UInt32,
    employeeID UInt32,
    employeeName String
    ),
    task Nested(
     taskID String,
     employeeID UInt32,
     details Nested (
       taskDetailID UInt32,
       description String
     )
   )
) ENGINE = MergeTree()
ORDER BY ( team.teamID, team.employeeID, task.details.taskDetailID, task.taskID);

Output:

CREATE TABLE SOME_RAW_TABLE
(
    `team` Nested(teamID UInt32, employeeID UInt32, employeeName String),
    `task` Nested(taskID String, employeeID UInt32, details Nested(taskDetailID UInt32, description String))
)
ENGINE = MergeTree
ORDER BY (team.teamID, team.employeeID, task.details.taskDetailID, task.taskID)

Query id: 43d6b811-47a3-4a32-8783-e88bb099a88f


0 rows in set. Elapsed: 0.002 sec.

Received exception from server (version 23.6.2):
Code: 47. DB::Exception: Received from localhost:9000. DB::Exception: Missing columns: 'task.details.taskDetailID' while processing query: 'team.teamID, team.employeeID, task.details.taskDetailID, task.taskID', required columns: 'team.teamID' 'task.details.taskDetailID' 'team.employeeID' 'task.taskID' 'team.teamID' 'task.details.taskDetailID' 'team.employeeID' 'task.taskID'. (UNKNOWN_IDENTIFIER)

from clickhouse-backup.

nahwinrajan avatar nahwinrajan commented on July 2, 2024

Oh, this is weird.

If I change task.details.taskDetailID to task.details.1 it works!
If I exclude task.details.taskDetailID from Order By (Primary Key Index) it will also work.

from clickhouse-backup.

Slach avatar Slach commented on July 2, 2024

@nahwinrajan
your issue is not related to clickhouse-backup
look to https://clickhouse.com/docs/en/sql-reference/data-types/nested-data-structures/nested
and https://clickhouse.com/docs/en/operations/settings/settings#flatten-nested
https://fiddle.clickhouse.com/55cd5988-bdc0-4610-9662-d8f51fed9970

Nested is "array of tuples"
looks like this you can't use named tuple element in primary key and it looks like clickhouse-server bug

from clickhouse-backup.

nahwinrajan avatar nahwinrajan commented on July 2, 2024

So I need to set the SET flatten_nested to 0 first ?
that is global setting right ?

additional information: with the previous way even though it was successfully creted the table, each field of the nested fields become an array on its own. And am not successful to do insertion into it (even after making values of each field is and array and array of array).

Now back to start with SET flatten_nested = 0; as it return the same error as this issue mentioned.

Edit:

  • The insert work by doing .IndexOfTheFileds and it start from 1 instead of 0 (not zero based index)
  • Am aware of this Issue-43634 but I am trying to do insert with SQL command
  • Interesting Resource: Clickhouse Online fiddle

from clickhouse-backup.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.