Package org.apache.drill.exec.store.mock
package org.apache.drill.exec.store.mock
Defines a mock data source which generates dummy test data for use
in testing. The data source operates in two modes:
- Classic: used in physical plans in many unit tests. The plan specifies a set of columns; data is generated by the vectors themselves based on two alternating values.
- Enhanced: available for use in newer unit tests. Enhances the physical plan description to allow specifying a data generator class (for various types, data formats, etc.) Also provides a data storage engine framework to allow using mock tables in SQL queries.
Classic Mode
Create a scan operator that looks like the following (from /src/test/resources/functions/cast/two_way_implicit_cast.json, used inTestReverseImplicitCast
):
graph:[
{
-
-
Class
Description
Defines a column for the "enhanced" version of the mock data
source.
Very simple date value generator that produces ISO dates
uniformly distributed over the last year.
Generates random field values uniformly distributed over
the range +-1 million, with any number of digits past
the decimal point.
Extended form of the mock record reader that uses generator class
instances to create the mock values.
Interface which all mock column data generators must
implement.
Generates integer values uniformly randomly distributed over
the entire 32-bit integer range from
Integer.MIN_VALUE
to Integer.MAX_VALUE
.
Each storage plugin requires a unique config class to allow
config --> impl lookups to be unique.
Describes a "group" scan of a (logical) mock table.
Describes a physical scan operation for the mock data source.
Structure of a mock table definition file.
Meta-data description of the columns we wish to create during a simulated
scan.
Describes one simulated file (or block) within the logical file scan
described by this group scan.
A tiny wrapper class to add required DrillTableSelection behaviour to
the entries list.
Generates a mock money field as a double over the range 0
to 1 million.
Generates a mock string field of the given length.