Skip to content

Zng beta#1394

Merged
mccanne merged 16 commits intomasterfrom
zng-beta
Oct 8, 2020
Merged

Zng beta#1394
mccanne merged 16 commits intomasterfrom
zng-beta

Conversation

@mccanne
Copy link
Collaborator

@mccanne mccanne commented Sep 30, 2020

This commit updates the ZNG spec based on deployment experience,
further comparisons with other approaches, and team feedback.
We hope to make no more backward incompatible changes and have
the ZNG format finalized by spring 2021.

Various encoding changes were made to improve the ergonomcis
of the format and simplify the implementation.

New types haven been added: bytes, enum, map, type, and error.
Float32 is coming soon in a subsequent PR.

New functions are: typeOf(), isErr(), fromBase64(), and toBase64().

The index operator (i.e., []) now works on records and maps,
in addition to arrays, and record types can now handle arbitrary
strings as keys, e.g., rec[".@_FOO"].

The alpha-zng autodetector now works.

Closes #1291, #1314, #1315, #1317, #1365, #1220

OLD DRAFT COMMENT

Here is a draft for commentary of the zng-beta branch as a draft merge off of the eval branch. This will hopefully get merged shortly after the big eval PR is merged...

Please provide any thoughts or feedback on the beta version of zng/docs/spec.md. The intention is to have no more backward incompatible changes and hopefully also no more forward-incompatible changes but I'm less concerned about the latter.

Since putting up this PR, I updated the zngio reader/writert o conform with the new control codes. Now that this is in, the alpha-zng autodetector should work.

@mccanne mccanne requested review from a team, jameskerr, mason-fish and philrz September 30, 2020 03:37
@mccanne mccanne marked this pull request as draft September 30, 2020 03:42
Copy link
Contributor

@philrz philrz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found one link worth adding, but otherwise @henridf seems to have already spotted the typos I would have spoken up about. 👍

zng/docs/spec.md Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> For example, the zqd server uses application-defined message `0xf7`
> For example, the [zqd](../../cmd/zqd) server uses application-defined message `0xf7`

Base automatically changed from eval to master October 2, 2020 04:35
@mccanne mccanne force-pushed the zng-beta branch 2 times, most recently from 747d33b to b4f6a5a Compare October 5, 2020 05:04
@mccanne mccanne marked this pull request as ready for review October 5, 2020 05:06
Comment on lines +72 to +73
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"typeof": {1, 1, typeOf},
"iserr": {1, 1, isErr},
"typeOf": {1, 1, typeOf},
"isErr": {1, 1, isErr},

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@philrz and I talked about function names and I think we need a group consensus around naming conventions. The current name all are package-style but we don't have packages so that seems wrong. I'm not sure about lower camelCase. It seems a little arbitrary. Also for a interactive query language where a user often type lots of stuff rapid fire, getting capitalization right seems like a mistake. I guess I am arguing for snake case where underscores are used only for long names that are less often types. How about I leave this for now and we do a PR soon on whatever we decide. Issue #1426

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add a comment here (or above the zenum alias) that these are expected to be temporary pending changes in json ingest handling, and were here for compatibility just for the existing json ingest process.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There don't seem to be any tests that exercise this. If I comment them out, all tests pass. But I'm pretty sure the typings stuff needs this and you are totally correct that the typings schema policy should define what zenum and port are rather than being hardcoded here. I will add the comment you suggest. I can't find an issue where to hang this so I will create a new one but it will probably be redundant with the larger task of imrpoving schema maps. #1427

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a github issue you can reference here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, #1417 though I needed to clarify it. I will put a comment in the code here that refers to #1417. This is a quick PR after this is merged to clean this up and do proper error checks.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this mean?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed the comment to refer to #1417

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove, or add comment to github issue to re-instate port searching.

Copy link
Collaborator Author

@mccanne mccanne Oct 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll remove the commented-out code. Issue #1428

zng/enum.go Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you please add a ztest that uses an enum? I didn't see one.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, good catch. I found the enum test I thought I had committed and it reminded me I had another loose end to take care of... all done.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, there's some hokiness to the enum values in the type syntax...

#0:record[e:enum[int32,foo:[1],bar:[2],baz:[4]]]

This is the first time value syntax appeared in the type syntax.
I wrapped the values here in [] since this is escaped by the tzng value syntax and commas aren't. It's a bit ugly. I had one thought here: we could change the tzng value encoding to use comma separation instead of semi-colon termination (and otherwise keep brackets) so that the type syntax and value syntax is consistent (@philrz suggested this a year ago). Now would be the time to change this since it will break tzng format (it also messes up the azng updater). The good news is only two small places in the code would need to change (but many tests would need to be updated).

Copy link
Member

@nwt nwt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@mccanne mccanne merged commit fa68b5f into master Oct 8, 2020
@mccanne mccanne deleted the zng-beta branch October 8, 2020 07:05
brim-bot pushed a commit to brimdata/zui that referenced this pull request Oct 9, 2020
…hilrz

This is an auto-generated commit with a zq dependency update. The zq PR
brimdata/super#1457, authored by @philrz,
has been merged.

Link fixes mostly related to ZNG spec update

While it's convenient to be able to link directly to anchors for specific sections in docs as we've been doing, one of the hazards is that when a destination changes, the link doesn't show up as "broken" by our automation because the user just ends up being redirected to the top of the page in question. brimdata/super#1394 renumbered some sections in the ZNG spec, so here I've manually rechecked relevant anchor links and made sure they go to the right places again.

While I was at it, I found some absolute URLs that I changed to be relative. This makes for better links when working in branches.
This was linked to issues Oct 15, 2020
@philrz philrz mentioned this pull request Oct 15, 2020
@philrz philrz linked an issue Oct 19, 2020 that may be closed by this pull request
@philrz philrz linked an issue Oct 19, 2020 that may be closed by this pull request
@philrz philrz linked an issue Oct 19, 2020 that may be closed by this pull request
@philrz philrz linked an issue Oct 19, 2020 that may be closed by this pull request
brim-bot pushed a commit to brimdata/zui that referenced this pull request Oct 20, 2020
This is an auto-generated commit with a zq dependency update. The zq PR
brimdata/super#1515, authored by @nwt,
has been merged.

Handle sets with a complex element type

brimdata/super#1394 changed the zng specification to allow sets with a complex element type. This implements the change.
@philrz philrz linked an issue Oct 23, 2020 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

5 participants