Skip to content

Repository files navigation

Data Prep

cm-availablecdap-transformBuild StatusCoverity Scan Build StatusMaven CentralJavadocLicenseJoin CDAP community

A collection of libraries, a pipeline plugin, and a CDAP service for performing data cleansing, transformation, and filtering using a set of data manipulation instructions (directives). These instructions are either generated using an interative visual tool or are manually created.

New Features

More here on upcoming features.

  • User Defined Directives, also known as UDD, allow you to create custom functions to transform records within CDAP DataPrep or a.k.a Wrangler. CDAP comes with a comprehensive library of functions. There are however some omissions, and some specific cases for which UDDs are the solution. Additional information on how you can build your custom directives here.

    • Migrating directives from version 1.0 to version 2.0 here
    • Information about Grammar here
    • Various TokenType supported by system here
    • Custom Directive Implementation Internals here
  • A new capability that allows CDAP Administrators to restrict the directives that are accessible to their users. More information on configuring can be found here

Demo Videos and Recipes

Videos and Screencasts are best way to learn, so we have compiled simple, short screencasts that shows some of the features of Data Prep. Additional videos can be found here

Videos

Recipes

Available Directives

These directives are currently available:

DirectiveDescription
Parsers
JSON PathUses a DSL (a JSON path expression) for parsing JSON records
Parse as AVROParsing an AVRO encoded message - either as binary or json
Parse as AVRO FileParsing an AVRO data file
Parse as CSVParsing an input record as comma-separated values
Parse as DateParsing dates using natural language processing
Parse as ExcelParsing excel file.
Parse as Fixed LengthParses as a fixed length record with specified widths
Parse as HL7Parsing Health Level 7 Version 2 (HL7 V2) messages
Parse as JSONParsing a JSON object
Parse as LogParses access log files as from Apache HTTPD and nginx servers
Parse as ProtobufParses an Protobuf encoded in-memory message using descriptor
Parse as Simple DateParses date strings
Parse XML To JSONParses an XML document into a JSON structure
Parse as CurrencyParses a string representation of currency into a number.
Parse as DatetimeParses strings with datetime values to CDAP datetime type
Output Formatters
Write as CSVConverts a record into CSV format
Write as JSONConverts the record into a JSON map
Write JSON ObjectComposes a JSON object based on the fields specified.
Format as CurrencyFormats a number as currency as specified by locale.
Transformations
Changing CaseChanges the case of column values
Cut CharacterSelects parts of a string value
Set ColumnSets the column value to the result of an expression execution
Find and ReplaceTransforms string column values using a "sed"-like expression
Index Split(Deprecated)
Invoke HTTPInvokes an HTTP Service (Experimental, potentially slow)
QuantizationQuantizes a column based on specified ranges
Regex Group ExtractorExtracts the data from a regex group into its own column
Setting Character SetSets the encoding and then converts the data to a UTF-8 String
Setting Record DelimiterSets the record delimiter
Split by SeparatorSplits a column based on a separator into two columns
Split Email AddressSplits an email ID into an account and its domain
Split URLSplits a URL into its constituents
Text Distance (Fuzzy String Match)Measures the difference between two sequences of characters
Text Metric (Fuzzy String Match)Measures the difference between two sequences of characters
URL DecodeDecodes from the application/x-www-form-urlencoded MIME format
URL EncodeEncodes to the application/x-www-form-urlencoded MIME format
TrimFunctions for trimming white spaces around string data
Encoders and Decoders
DecodeDecodes a column value as one of base32, base64, or hex
EncodeEncodes a column value as one of base32, base64, or hex
Unique ID
UUID GenerationGenerates a universally unique identifier (UUID) .Recommended to use with Wrangler version 4.4.0 and above due to an important bug fix CDAP-17732
Date Transformations
Diff DateCalculates the difference between two dates
Format DateCustom patterns for date-time formatting
Format Unix TimestampFormats a UNIX timestamp as a date
DateTime Transformations
Current DateTimeGenerates the current datetime using the given zone or UTC by default
Datetime To TimestampConverts a datetime value to timestamp with the given zone
Format DatetimeFormats a datetime value to custom date time pattern strings
Timestamp To DatetimeConverts a timestamp value to datetime
Lookups
Catalog LookupStatic catalog lookup of ICD-9, ICD-10-2016, ICD-10-2017 codes
Table LookupPerforms lookups into Table datasets
Hashing & Masking
Message Digest or HashGenerates a message digest
Mask NumberApplies substitution masking on the column values
Mask ShuffleApplies shuffle masking on the column values
Row Operations
Filter Row if MatchedFilters rows that match a pattern for a column
Filter Row if TrueFilters rows if the condition is true.
Filter Row Empty of NullFilters rows that are empty of null.
FlattenSeparates the elements in a repeated field
Fail on conditionFails processing when the condition is evaluated to true.
Send to ErrorFiltering of records to an error collector
Send to Error And ContinueFiltering of records to an error collector and continues processing
Split to RowsSplits based on a separator into multiple records
Column Operations
Change Column CaseChanges column names to either lowercase or uppercase
Changing CaseChange the case of column values
Cleanse Column NamesSanatizes column names, following specific rules
Columns ReplaceAlters column names in bulk
CopyCopies values from a source column into a destination column
Drop ColumnDrops a column in a record
Fill Null or Empty ColumnsFills column value with a fixed value if null or empty
Keep ColumnsKeeps specified columns from the record
Merge ColumnsMerges two columns by inserting a third column
Rename ColumnRenames an existing column in the record
Set Column HeaderSets the names of columns, in the order they are specified
Split to ColumnsSplits a column based on a separator into multiple columns
Swap ColumnsSwaps column names of two columns
Set Column Data TypeConvert data type of a column
NLP
Stemming Tokenized WordsApplies the Porter stemmer algorithm for English words
Transient Aggregators & Setters
Increment VariableIncrements a transient variable with a record of processing.
Set VariableSets a transient variable with a record of processing.
Functions
Data QualityData quality check functions. Checks for date, time, etc.
Date ManipulationsFunctions that can manipulate date
DDLFunctions that can manipulate definition of data
JSONFunctions that can be useful in transforming your data
TypesFunctions for detecting the type of data

Performance

Initial performance tests show that with a set of directives of high complexity for transforming data, DataPrep is able to process at about ~106K records per second. The rates below are specified as records/second.

Directive ComplexityColumn CountRecordsSizeMean Rate
High (167 Directives)426127,946,39882,677,845,324106,367.27
High (167 Directives)426511,785,592330,711,381,296105,768.93

Contact

Mailing Lists

CDAP User Group and Development Discussions:

The cdap-user mailing list is primarily for users using the product to develop applications or building plugins for appplications. You can expect questions from users, release announcements, and any other discussions that we think will be helpful to the users.

IRC Channel

CDAP IRC Channel: #cdap on irc.freenode.net

Slack Team

CDAP Users on Slack: cdap-users team

License and Trademarks

Copyright © 2016-2019 Cask Data, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Cask is a trademark of Cask Data, Inc. All rights reserved.

Apache, Apache HBase, and HBase are trademarks of The Apache Software Foundation. Used with permission. No endorsement by The Apache Software Foundation is implied by the use of these marks.

About

Wrangler Transform: A DMD system for transforming Big Data

Resources

Security policy

Stars

109 stars

Watchers

8 watching

Forks

Releases

Packages

Used by

Contributors

Languages