You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Adam Kennedy (Jira)" <ji...@apache.org> on 2023/04/15 00:51:00 UTC

[jira] [Assigned] (CALCITE-5649) Produce row count statistics from ReflectiveSchema for array based tables

     [ https://issues.apache.org/jira/browse/CALCITE-5649?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Adam Kennedy reassigned CALCITE-5649:
-------------------------------------

    Assignee: Adam Kennedy

> Produce row count statistics from ReflectiveSchema for array based tables
> -------------------------------------------------------------------------
>
>                 Key: CALCITE-5649
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5649
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.34.0
>            Reporter: Adam Kennedy
>            Assignee: Adam Kennedy
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> When testing new Calcite implementations it is easy to use (and several online examples indeed use) a trivial reflected synthetic schema such as the following:
> {code:java}
>     public Schema getSchema() {
>         return new ReflectiveSchema(new PeopleSchema());
>     }
>     public static final class PeopleSchema {
>         public final Person[] heroes = {
>                 new Person("Ironman", 12),
>                 new Person("Batman", 10)
>         };
>         public static class Person {
>             public final String name;
>             public final int age;
>             public Person(final String name, final int age) {
>                 this.name = name;
>                 this.age = age;
>             }
>         }
>     }
> {code}
> While this works for some basics, the lack of statistics makes it less useful than it could be. While not all variations supported by ReflectiveSchema can easily capture statistics, the variation which provides the table as an array has trivial access to a valid RowCount value.
> For these simple cases ReflectiveSchema should provide a Statistic object with a valid row count so the simple synthetic schemas will be more useful.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)