lucidworks / zeppelin-solr

Apache Solr interpreter for Apache Zeppelin
Apache License 2.0
28 stars 4 forks source link

Preserve null fields #27

Closed joel-bernstein closed 4 years ago

joel-bernstein commented 4 years ago

Currently the table header is taken from the first result when processing streaming expressions. Also each subsequent tuple is assumed to have each field the first tuple has. This causes all kinds of display problems when either the first tuple or subsequent tuples don't contain all fields in the result set.

In general this doesn't cause issues with aggregations or statistical visualizations because these result sets have very consistent field structure across the result set. But it reeks havoc with exploratory searches viewed in tables.

This ticket does a very thorough job of creating the header by looping through each tuple to create the unique set of fields. It also ensures that nulls are preserved in all tuples with tabs.

joel-bernstein commented 4 years ago

As a nice added bonus this ticket also simplifies the output for different types by simply calling toString on each tuple value. This means arrays are now bracketed in the Zeppelin table viz.

joel-bernstein commented 4 years ago

All unit tests pass so I plan to merge to master shortly. I'll do more testing from master before a release.