ifExists=FIND_OR_CREATE_VERSION
and firstVersion
behaviour
#6004
Replies: 1 comment 3 replies
-
When using The logic should be this:
You can also optionally add the I just threw together a unit test to make sure everything was working as I expected (we have tests for this already but I wanted to gather all the variants together in one place to make sure it works and to illustrate it better for you): https://gist.github.com/EricWittmann/a4b606d622b6a936ea64bbd379490408 It's possible you're doing something slightly different than this? Let me know and I will add appropriate tests. |
Beta Was this translation helpful? Give feedback.
-
Hello.
I am trying to understand the behaviour of
ifExists=FIND_OR_CREATE_VERSION
andfirstVersion
.If I create a Schema with the following AVRO content:
"{\"type\":\"record\",\"name\":\"ExampleType\",\"fields\":[{\"name\":\"sdfgfsdgsdg\",\"type\":\"string\"},{\"name\":\"field2\",\"type\":\"int\"},{\"name\":\"field3\",\"type\":\"string\",\"default\":\"\"}]}"
with afirstVersion
"1".If I create the Schema again with the same content, version "1" is returned.
If I create the Schema again with a different but compatible content, there is an error:
VersionAlreadyExistsException: An artifact version '1' for artifact ID ... in group ... already exists.
. I was expecting that a new version would be created in this case.My question is, how does
ifExists
andfirstVersion
co-exist?Thank you.
Beta Was this translation helpful? Give feedback.
All reactions