drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-5258) Allow "extended" mock tables access from SQL queries
Date Wed, 22 Feb 2017 01:24:44 GMT

    [ https://issues.apache.org/jira/browse/DRILL-5258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15877195#comment-15877195
] 

ASF GitHub Bot commented on DRILL-5258:
---------------------------------------

Github user sohami commented on a diff in the pull request:

    https://github.com/apache/drill/pull/752#discussion_r102320948
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/store/mock/MockStorageEngine.java
---
    @@ -89,14 +85,30 @@ public boolean supportsRead() {
         return true;
       }
     
    -//  public static class ImplicitTable extends DynamicDrillTable {
    -//
    -//    public ImplicitTable(StoragePlugin plugin, String storageEngineName,
    -//        Object selection) {
    -//      super(plugin, storageEngineName, selection);
    -//    }
    -//
    -//  }
    +  /**
    +   * Resolves table names within the mock data source. Tables can be of two forms:
    +   * <p>
    +   * <tt><name>_<n><unit></tt>
    +   * <p>
    +   * Where the "name" can be anything, "n" is the number of rows, and "unit" is
    +   * the units for the row count: non, K (thousand) or M (million).
    +   * <p>
    +   * The above form generates a table directly with no other information needed.
    +   * Column names must be provided, and must be of the form:
    +   * <p>
    +   * <tt><name>_<type><size></tt>
    +   * <p>
    +   * Where the name can be anything, the type must be i (integer), d (double)
    +   * or s (string, AKA VarChar). The length is needed only for string fields.
    --- End diff --
    
    how about boolean (b) as a type ?


> Allow "extended" mock tables access from SQL queries
> ----------------------------------------------------
>
>                 Key: DRILL-5258
>                 URL: https://issues.apache.org/jira/browse/DRILL-5258
>             Project: Apache Drill
>          Issue Type: Improvement
>    Affects Versions: 1.10
>            Reporter: Paul Rogers
>            Assignee: Paul Rogers
>            Priority: Minor
>             Fix For: 1.10
>
>
> DRILL-5152 provided a simple way to generate sample data in SQL using a new, simplified
version of the mock data generator. This approach is very convenient, but is inherently limited.
For example, the limited syntax available in SQL does not encoding much information about
columns such as repeat count, data generator or so on. The simple SQL approach does not allow
generating multiple groups of data.
> However, all these features are present in the original mock data source via a special
JSON configuration file. Previously, only physical plans could access that extended syntax.
> This ticket requests a SQL interface to the extended mock data source:
> {code}
> SELECT * FROM `mock`.`example/mock-options.json`
> {code}
> Mock data source options are always stored as a JSON file. Since the existing mock data
generator for SQL never uses JSON files, a simple rule is that if the table name ends in ".json"
then it is a specification, else the information is encoded in table and column names.
> The format of the data generation syntax is documented in the mock data source classes.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message