Clone Tools
  • last updated 29 mins ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
DRILL-7442: Create multi-batch row set reader

Adds a ResultSetReader that works across multiple batches

in a result set. Reuses the same row set and readers if

schema is unchanged, creates a new set if the schema changes.

Adds a unit test for the result set reader.

Adds a "rebind" capability to the row set readers to focus

on new buffers under an existing set of vectors. Used when

a new batch arrives, if the schema is unchanged.

Extends row set classses to be aware of the BatchAccessor class

which encapsulates a container and optional selection vector,

and tracks schema changes.

Moves row set tests into the same package as the row sets.

(Row set classes were moved a while back, but the tests were

not moved.)

Renames some BatchAccessor methods.

closes #1897

  1. … 61 more files in changeset.
DRILL-7439: Batch count fixes for six additional operators

Enables vector checks, and fixes batch count and vector issues for:

* StreamingAggBatch

* RuntimeFilterRecordBatch

* FlattenRecordBatch

* MergeJoinBatch

* NestedLoopJoinBatch

* LimitRecordBatch

Also fixes a zero-size batch validity issue for the CSV reader when

all files contain no data.

Includes code cleanup for files touched in this PR.

closes #1893

  1. … 18 more files in changeset.
DRILL-6096: Provide mechanism to configure text writer configuration

1. Usage of format plugin configuration allows to specify line and field delimiters, quotes and escape characters.

2. Usage of system / session options allows to specify if writer should add headers, force quotes.

closes #1873

  1. … 19 more files in changeset.
DRILL-7358: Fix COUNT(*) for empty text files

Fixes a subtle error when a text file has a header (and so has a

schema), but is in a COUNT(*) query, so that no columns are

projected. Ensures that, in this case, an empty schema is

treated as a valid result set.

Tests: updated CSV tests to include this case.

closes #1867

    • -0
    • +3
    ./project/projSet/EmptyProjectionSet.java
  1. … 7 more files in changeset.
DRILL-7350: Move RowSet related classes from test folder

    • -1
    • +1
    ./columns/ResolvedColumnsArrayColumn.java
    • -1
    • +1
    ./columns/UnresolvedColumnsArrayColumn.java
    • -1
    • +1
    ./project/AbstractUnresolvedColumn.java
    • -2
    • +2
    ./project/ExplicitSchemaProjection.java
  1. … 278 more files in changeset.
DRILL-7306: Disable schema-only batch for new scan framework

The EVF framework is set up to return a "fast schema" empty batch

with only schema as its first batch because, when the code was

written, it seemed that's how we wanted operators to work. However,

DRILL-7305 notes that many operators cannot handle empty batches.

Since the empty-batch bugs show that Drill does not, in fact,

provide a "fast schema" batch, this ticket asks to disable the

feature in the new scan framework. The feature is disabled with

a config option; it can be re-enabled if ever it is needed.

SQL differentiates between two subtle cases, and both are

supported by this change.

1. Empty results: the query found a schema, but no rows

are returned. If no reader returns any rows, but at

least one reader provides a schema, then the scan

returns an empty batch with the schema.

2. Null results: the query found no schema or rows. No

schema is returned. If no reader returns rows or

schema, then the scan returns no batch: it instead

immediately returns a DONE status.

For CSV, an empty file with headers returns the null result set

(because we don't know the schema.) An empty CSV file without headers

returns an empty result set because we do know the schema: it will

always be the columns array.

Old tests validate the original schema-batch mode, new tests

added to validate the no-schema-batch mode.

    • -1
    • +63
    ./project/ScanSchemaOrchestrator.java
  1. … 38 more files in changeset.
DRILL-6951: Merge row set based mock data source

The mock data source is used in several tests to generate a large volume

of sample data, such as when testing spilling. The mock data source also

lets us try new plugin featues in a very simple context. During the

development of the row set framework, the mock data source was converted

to use the new framework to verify functionality. This commit upgrades

the mock data source with that work.

The work changes non of the functionality. It does, however, improve

memory usage. Batchs are limited, by default, to 10 MB in size. The row

set framework minimizes internal fragmentation in the largest vector.

(Previously, internal fragmentation averaged 25% but could be as high as

50%.)

As it turns out, the hash aggregate tests depended on the internal

fragmentation: without it, the hash agg no longer spilled for the same

row count. Adjusted the generated row counts to recreate a data volume

that caused spilling.

One test in particular always failed due to assertions in the hash agg

code. These seem true bugs and are described in DRILL-7301. After

multiple failed attempts to get the test to work, it ws disabled until

DRILL-7301 is fixed.

Added a new unit test to sanity check the mock data source. (No test

already existed for this functionality except as verified via other unit

tests.)

  1. … 21 more files in changeset.
DRILL-7293: Convert the regex ("log") plugin to use EVF

Converts the log format plugin (which uses a regex for parsing) to work

with the Extended Vector Format.

User-visible behavior changes added to the README file.

* Use the plugin config object to pass config to the Easy framework.

* Use the EVF scan mechanism in place of the legacy "ScanBatch"

mechanism.

* Minor code and README cleanup.

* Replace ad-hoc type conversion with builtin conversions

The provided schema support in the enhanced vector framework (EVF)

provides automatic conversions from VARCHAR to most types. The log

format plugin was created before EVF was available and provided its own

conversion mechanism. This commit removes the ad-hoc conversion code and

instead uses the log plugin config schema information to create an

"output schema" just as if it was provided by the provided schema

framework.

Because we need the schema in the plugin (rather than the reader), moved

the schema-parsing code out of the reader into the plugin. The plugin

creates two schemas: an "output schema" with the desired output types,

and a "reader schema" that uses only VARCHAR. This causes the EVF to

perform conversions.

* Enable provided schema support

Allows the user to specify types using either the format config (as

previously) or a provided schema. If a schema is provided, it will match

columns using names specified in the format config.

The provided schema can specify both types and modes (nullable or not

null.)

If a schema is provided, then the types specified in the plugin config

are ignored. No attempt is made to merge schemas.

If a schema is provided, but a column is omitted from the schema, the

type defaults to VARCHAR.

* Added ability to specify regex in table properties

Allows the user to specify the regex, and the column schema,

using a CREATE SCHEMA statement. The README file provides the details.

Unit tests demonstrate and verify the functionality.

* Used the custom error context provided by EVF to enhance the log format

reader error messages.

* Added user name to default EVF error context

* Added support for table functions

Can set the regex and maxErrors fields, but not the schema.

Schema will default to "field_0", "field_1", etc. of type

VARCHAR.

* Added unit tests to verify the functionality.

* Added a check, and a test, for a regex with no groups.

* Added columns array support

When the log regex plugin is given no schema, it previously

created a list of columns "field_0", "field_1", etc. After

this change, the plugin instead follows the pattern set by

the text plugin: it will place all fields into the columns

array. (The two special fields are still separate.)

A few adjustments were necessary to the columns array

framework to allow use of the special columns along with

the `columns` column.

Modified unit tests and the README to reflect this change.

The change should be backward compatible because few users

are likely relying on the dummy field names.

Added unit tests to verify that schema-based table

functions work. A test shows that, due to the unforunate

config property name "schema", users of this plugin cannot

combine a config table function with the schema attribute

in the way promised in DRILL-6965.

    • -1
    • +18
    ./columns/ColumnsScanFramework.java
  1. … 15 more files in changeset.
DRILL-7292: Remove V1 and V2 text readers

Drill 1.16 introduced the "V2" text reader based on the row set

and provided schema mechanisms. V3 was available by system/session

option as the functionality was considered experimental.

The functionality has now undergone thorough testing. This commit makes

the V3 text reader available by default, and removes the code for the

original "V1" and the "new" (compliant, "V2") text reader.

The system/session options that controlled reader selection are retained

for backward compatibility, but they no longer do anything.

Specific changes:

* Removed the V2 "compliant" text reader.

* Moved the "V3" to replace the "compliant" version.

* Renamed the "complaint" package to "reader."

* Removed the V1 text reader.

* Moved the V1 text writer (still used with the V2 and V3 readers)

into a new "writer" package adjacent to the reader.

* Removed the CSV tests for the V2 reader, including those that

demonstrated bugs in V2.

* V2 did not properly handle the quote escape character. One or two unit

tests depended on the broken behavior. Fixed them for the correct

behavior.

* Behavior of "messy quotes" (those that appear in a non-quoted field)

was undefined for the text reader. Added a test to clearly demonstrate

the (somewhat odd) behavior. The behavior itself was not changed.

Reran all unit tests to ensure that they work with the now-default V3

text reader.

closes #1806

  1. … 59 more files in changeset.
DRILL-7279: Enable provided schema for text files without headers

* Allows a provided schema for text files without headers. The

provided schema columns replace the `columns` column that is

normally used.

* Allows customizing text format properties using table properties.

The table properties "override" properties set in the plugin config.

* Added unit tests for the newly supported use cases.

* Fixed bug in quote escape handling.

closes #1798

  1. … 13 more files in changeset.
DRILL-7261: Simplify Easy framework config for new scan

Most format plugins are created using the Easy format plugin. A recent

change added support for the "row set" scan framework. After converting

the text and log reader plugins, it became clear that the setup code

could be made simpler.

* Add the user name to the "file scan" framework.

* Pass the file system, split and user name to the batch reader via

the "schema negotiator" rather than via the constructor.

* Create the traditional "scan batch" scan or the new row-set scan via

functions instead of classes.

* Add Easy config option and method to choose the kind of scan

framework.

* Add Easy config options for some newer options such as whether the

plugin supports statistics.

Simplified reader creation

* The batch reader can be created just by overriding a method.

* A default error context is provided if the plugin does not provide

one.

Tested by running all unit tests for the CSV reader which is based on

the new framework, and by testing the converted log reader (that reader

is not part of this commit.)

closes #1796

  1. … 3 more files in changeset.
DRILL-7278: Refactor result set loader projection mechanism

Drill 1.16 added a enhanced scan framework based on the row set

mechanisms, and a "provisioned schema" feature build on top

of that framework. Conversion of the log reader plugin to use

the framework identified additional features we wish to add,

such as marking a column as "special" (not expanded in a wildcard

query.)

This work identified that the code added for provisioned schemas in

Drill 1.16 worked, but is a bit overly complex, making it hard to add

the desired new feature.

This patch refactors the "reader" projection code:

* Create a "projection set" mechanism that the reader can query to ask,

"the caller just added a column. Should it be projected or not?"

* Unifies the type conversion mechanism added as part of provisioned

schemas.

* Added the "special column" property for both "reader" and "provided"

schemas.

* Verified that provisioned schemas work with maps (at least on the scan

framework side.)

* Replaced the previous "schema transformer" mechanism with a new "type

conversion" mechanism that unifies type conversion, provided schemas

and an optional custom type conversion mechanism.

* Column writers can report if they are projected. Moved this query

from metadata to the column writer itself.

* Extended and clarified documentation of the feature.

* Revised and/or added unit tests.

closes #1797

    • -12
    • +26
    ./project/AbstractUnresolvedColumn.java
    • -10
    • +8
    ./project/ReaderSchemaOrchestrator.java
    • -24
    • +39
    ./project/ScanLevelProjection.java
    • -49
    • +19
    ./project/ScanSchemaOrchestrator.java
    • -17
    • +18
    ./project/WildcardSchemaProjection.java
    • -0
    • +80
    ./project/projSet/AbstractProjectionSet.java
    • -0
    • +50
    ./project/projSet/AbstractReadColProj.java
    • -0
    • +40
    ./project/projSet/EmptyProjectionSet.java
    • -0
    • +109
    ./project/projSet/ExplicitProjectionSet.java
    • -0
    • +39
    ./project/projSet/ProjectedMapColumn.java
    • -0
    • +78
    ./project/projSet/ProjectedReadColumn.java
    • -0
    • +101
    ./project/projSet/ProjectionSetBuilder.java
    • -0
    • +79
    ./project/projSet/ProjectionSetFactory.java
  1. … 58 more files in changeset.
DRILL-7181: Improve V3 text reader (row set) error messages

Adds an error context to the User Error mechanism. The context allows

information to be passed through an intermediate layer and applied when

errors are raised in lower-level code; without the need for that

low-level code to know the details of the error context information.

Modifies the scan framework and V3 text plugin to use the framework to

improve error messages.

Refines how the `columns` column can be used with the text reader. If

headers are used, then `columns` is just another column. An error is

raised, however, if `columns[x]` is used when headers are enabled.

Added another builder abstraction where a constructor argument list

became too long.

Added the drill file system and split to the file schema negotiator

to simplify reader construction.

Added additional unit tests to fully define the `columns` column

behavior.

    • -0
    • +16
    ./framework/SchemaNegotiatorImpl.java
    • -7
    • +14
    ./project/ExplicitSchemaProjection.java
    • -0
    • +8
    ./project/ReaderSchemaOrchestrator.java
    • -14
    • +92
    ./project/ScanLevelProjection.java
    • -7
    • +35
    ./project/ScanSchemaOrchestrator.java
  1. … 25 more files in changeset.
DRILL-7143: Support default value for empty columns

Modifies the prior work to add default values for columns. The prior work added defaults

when the entire column is missing from a reader (the old Nullable Int column). The Row

Set mechanism now will also "fill empty" slots with the default value.

Added default support for the column writers. The writers automatically obtain the

default value from the column schema. The default can also be set explicitly on

the column writer.

Updated the null column mechanism to use this feature rather than the ad-hoc

implemention in the prior commit.

Semantics changed a bit. Only Required columns take a default. The default value

is ignored or nullable columns since nullable columns already have a file default: NULL.

Other changes:

* Updated the CSV-with-schema tests to illustrate the new behavior.

* Made multiple fixes for Boolean and Decimal columns and added unit tests.

* Upgraded Fremarker to version 2.3.28 to allow use of the continue statement.

* Reimplemented the Bit column reader and writer to use the BitVector directly since this vector is rather special.

* Added get/set Boolean methods for column accessors

* Moved the BooleanType class to the common package

* Added more CSV unit tests to explore decimal types, booleans, and defaults

* Add special handling for blank fields in from-string conversions

* Added options to the conversion factory to specify blank-handling behavior.

CSV uses a mapping of blanks to null (nullable) or default value (non-nullable)

closes #1726

    • -2
    • +19
    ./project/ScanSchemaOrchestrator.java
  1. … 68 more files in changeset.
DRILL-7011: Support schema in scan framework

* Adds schema support to the row set-based scan framework and to the "V3" text reader based on that framework.

* Adding the schema made clear that passing options as a long list of constructor arguments was not sustainable. Refactored code to use a builder pattern instead.

* Added support for default values in the "null column loader", which required adding a "setValue" method to the column accessors.

* Added unit tests for all new or changed functionality. See TestCsvWithSchema for the overall test of the entire integrated mechanism.

* Added tests for explicit projection with schema

* Better handling of date/time in column accessors

* Converted recent column metadata work from Java 8 date/time to Joda.

* Added more CSV-with-schema unit tests

* Removed the ID fields from "resolved columns", used "instanceof" instead.

* Added wildcard projection with an output schema. Handles both "lenient" and "strict" schemas.

* Tagged projection columns with their output schema, when available.

* Scan projection added modes for wildcard with an output schema. The reader projection added support for merging reader and output schemas.

* Includes refactoring of scan operator tests (the test file grew too large.)

* Renamed some classes to avoid confusing reader schemas with output schemas.

* Added unit tests for the new functionality.

* Added "lenient" wildcard with schema test for CSV

* Added more type conversions: string-to-bit, many-to-string

* Fixed bug in column writer for VarDecimal

* Added missing unit tests, and fixed bugs, in Bit column reader/writer

* Cleaned up a number of unneded "SuppressWarnings"

closes #1711

    • -48
    • +26
    ./columns/ColumnsScanFramework.java
    • -3
    • +2
    ./columns/ColumnsSchemaNegotiator.java
    • -5
    • +0
    ./columns/ResolvedColumnsArrayColumn.java
    • -5
    • +3
    ./columns/UnresolvedColumnsArrayColumn.java
    • -176
    • +0
    ./file/BaseFileScanFramework.java
    • -35
    • +154
    ./file/FileScanFramework.java
    • -190
    • +0
    ./framework/AbstractScanFramework.java
    • -0
    • +54
    ./framework/BasicScanFactory.java
  1. … 210 more files in changeset.
DRILL-7106: Fix Intellij warning for FieldSchemaNegotiator

closes #1698

    • -12
    • +1
    ./columns/ColumnsScanFramework.java
    • -0
    • +31
    ./columns/ColumnsSchemaNegotiator.java
  1. … 3 more files in changeset.
DRILL-7086: Output schema for row set mechanism

Enhances the row set mechanism to take an "output schema" that describes the vectors to

create. The "input schema" describes the type that the reader would like to write. A

conversion mechanism inserts a conversion shim to convert from the input to output type.

Provides a set of implicit type conversions, including string-to-date/time conversions

which use the new format property stored in column metadata. Includes unit tests for

the new functionality.

closes #1690

  1. … 65 more files in changeset.
DRILL-7074: Scan framework fixes and enhancements

Roll-up of fixes an enhancements that emerged from the effort to host the CSV reader on the new framework.

closes #1676

    • -29
    • +23
    ./columns/ColumnsArrayParser.java
    • -6
    • +65
    ./file/FileMetadataColumnsParser.java
    • -0
    • +76
    ./framework/AbstractScanFramework.java
    • -0
    • +1
    ./project/ExplicitSchemaProjection.java
  1. … 27 more files in changeset.
DRILL-6952: Host compliant text reader on the row set framework

The result set loader allows controlling batch sizes. The new scan framework

built on top of that framework handles projection, implicit columns, null

columns and more. This commit converts the "new" ("compliant") text reader

to use the new framework. Options select the use of the V2 ("new") or V3

(row-set based) versions. Unit tests demonstrate V3 functionality.

closes #1683

  1. … 54 more files in changeset.
DRILL-5603: Replace String file paths to Hadoop Path - replaced all String path representation with org.apache.hadoop.fs.Path - added PathSerDe.Se JSON serializer - refactoring of DFSPartitionLocation code by leveraging existing listPartitionValues() functionality

closes #1657

  1. … 82 more files in changeset.
DRILL-6950: Row set-based scan framework

Adds the "plumbing" that connects the scan operator to the result set loader and the scan projection framework. See the various package-info.java files for the technical datails. Also adds a large number of tests.

This PR does not yet introduce an actual scan operator: that will follow in subsequent PRs.

closes #1618

    • -0
    • +444
    ./ReaderState.java
    • -0
    • +206
    ./RowBatchReader.java
    • -0
    • +57
    ./ScanOperatorEvents.java
    • -0
    • +286
    ./ScanOperatorExec.java
    • -0
    • +137
    ./columns/ColumnsArrayManager.java
    • -0
    • +175
    ./columns/ColumnsArrayParser.java
    • -0
    • +134
    ./columns/ColumnsScanFramework.java
    • -0
    • +42
    ./columns/ResolvedColumnsArrayColumn.java
    • -0
    • +32
    ./columns/UnresolvedColumnsArrayColumn.java
    • -0
    • +23
    ./columns/package-info.java
    • -0
    • +166
    ./file/BaseFileScanFramework.java
    • -0
    • +77
    ./file/FileMetadata.java
    • -0
    • +75
    ./file/FileMetadataColumn.java
    • -0
    • +59
    ./file/FileMetadataColumnDefn.java
    • -0
    • +120
    ./file/FileMetadataColumnsParser.java
  1. … 47 more files in changeset.
DRILL-6791: Scan projection framework

The "schema projection" mechanism:

* Handles none (SELECT COUNT\(*)), some (SELECT a, b, x) and all (SELECT *) projection.

* Handles null columns (for projection a column "x" that does not exist in the base table.)

* Handles constant columns as used for file metadata (AKA "implicit" columns).

* Handle schema persistence: the need to reuse the same vectors across different scanners

* Provides a framework for consuming externally-supplied metadata

* Since we don't yet have a way to provide "real" metadata, obtains metadata hints from

previous batches and from the projection list (a.b implies that "a" is a map, c[0]

implies that "c" is an array, etc.)

* Handles merging the set of data source columns and null columns to create the final output batch.

* Running tests found a failure due to an uninialized "bits" vector. Added code to explicitly fill

the bits vectors with zeros in the "result set loader."

    • -0
    • +77
    ./project/ColumnProjection.java
    • -0
    • +111
    ./project/ConstantColumnLoader.java
    • -0
    • +251
    ./project/ExplicitSchemaProjection.java
    • -0
    • +73
    ./project/MetadataManager.java
    • -0
    • +58
    ./project/NoOpMetadataManager.java
    • -0
    • +115
    ./project/NullColumnBuilder.java
    • -0
    • +170
    ./project/NullColumnLoader.java
    • -0
    • +63
    ./project/ResolvedColumn.java
    • -0
    • +88
    ./project/ResolvedMapColumn.java
    • -0
    • +65
    ./project/ResolvedNullColumn.java
    • -0
    • +66
    ./project/ResolvedTableColumn.java
    • -0
    • +433
    ./project/ResolvedTuple.java
    • -0
    • +371
    ./project/ScanLevelProjection.java
    • -0
    • +570
    ./project/ScanSchemaOrchestrator.java
    • -0
    • +102
    ./project/SchemaLevelProjection.java
  1. … 19 more files in changeset.
DRILL-6540: Upgrade to HADOOP-3.0.3 libraries

- accomodate apache and mapr profiles with hadoop 3.0 libraries

- update HBase version

- fix jdbc-all woodox dependency

- unban Apache commons-logging dependency

  1. … 10 more files in changeset.