News for hackers. Stuff that matters.
Re:Show HN: ScratchDB – Open-Source Snowflake on ClickHouse by zepolen on Friday October 27, 2023 @05:54PM (#38044513)
What happens with this?

  {
    "some_key": "1"
    "some": {
      "key": "2"
    }
  }
Re:Show HN: ScratchDB – Open-Source Snowflake on ClickHouse by memset on Friday October 27, 2023 @06:24PM (#38044792)
Probably an error! Should create a ticket for that. What would we want the behavior to be?

(This hasn't come up with existing customers because theoretically it could and we should handle it.)

Re:Show HN: ScratchDB – Open-Source Snowflake on ClickHouse by namtab00 on Friday October 27, 2023 @07:08PM (#38045145)
maybe double the underscore on conflict?

some_key =1

some__key = 2

Re:Show HN: ScratchDB – Open-Source Snowflake on ClickHouse by dicriseg on Friday October 27, 2023 @07:38PM (#38045353)
The convention when flattening is exactly that I thought - an underscore per level of nesting. This is what I would expect to see too.
Re:Show HN: ScratchDB – Open-Source Snowflake on ClickHouse by memset on Friday October 27, 2023 @07:26PM (#38045261)
Agree. (What if the original users key has the double underscore?) maybe this can be defined as a param?
Re:Show HN: ScratchDB – Open-Source Snowflake on ClickHouse by namtab00 on Friday October 27, 2023 @07:53PM (#38045457)
> What if the original users key has the double underscore?

Double it again.

some_key = 1

some__key = 2

some____key = 3

This is analogous to what C#11 does to allow raw string literal quotes containing those same quotes. https://learn.microsoft.com/en-us/dotnet/csharp/language-ref...

Re:Show HN: ScratchDB – Open-Source Snowflake on ClickHouse by gostsamo on Saturday October 28, 2023 @01:30AM (#38047415)
escape the underscore. this is the only sane one, I think.
Re:Show HN: ScratchDB – Open-Source Snowflake on ClickHouse by mosen on Friday October 27, 2023 @06:45PM (#38044969)
I tested it with the “explode” flattening mode, and it resulted in { “some_key”: “2” }
Re:Show HN: ScratchDB – Open-Source Snowflake on ClickHouse by memset on Friday October 27, 2023 @07:26PM (#38045268)
Feel free to create a gh issue - really interested in what the right solution would be here!