-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Fix unable to sync json column with value is an array #44465
Conversation
(recur path key (assoc! res next-path clojure.lang.PersistentVector))) | ||
JsonToken/END_ARRAY (recur path key res))))))) | ||
;; only parse if the value is an object, ignore arrays, strings, numbers, etc. | ||
(and (zero? token-cnt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jackson doesn't have a peek method :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't we check (seq res)
here, seems like it should give the same result? Nothing collected and not a start of the object -> goodbye.
res (transient {})] | ||
(let [token (.nextToken p) | ||
next-path (cond-> path key (conj key))] | ||
(loop [path (or path []) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix here is reverese https://github.com/metabase/metabase/pull/43812/files, then add a check to make sure we return nil if the value is not an object.
Thread for context |
|
need to backport to 49 too |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except I'd love and
to become when
:)
@metabase-bot backport release-x.49.x |
a json column with values is an array or an atom should not have nested fields
Closes #44459