Wrangler command-line directives

This page describes the directives you can use in Wrangler.

In WranglerPower mode (the Wrangler CLI), you can add directivesand functions to a recipe. For more information, seeWrangler CLI Directives andWrangler Functions.

Wrangler supports the following directives:

Column operations

DirectiveDescription
Change Column CaseChanges column names to either lowercase or uppercase.
Changing CaseChanges the case of column values.
Cleanse Column NamesSanitizes 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 EmptyIf the value is null or empty, enters a fixed column value.
KeepKeeps specified columns from the record.
MergeMerges two columns by inserting a third column.
RenameRenames an existing column in the record.
Set HeadersSets the names of columns, in the order they're specified.
Split to ColumnsSplits a column based on a separator into multiple columns.
SwapSwaps column names of two columns.
Set TypeConverts the data type of a column.

Date transformations

DirectiveDescription
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

DirectiveDescription
Current DatetimeGenerates current datetime with a given time zone.
Datetime to TimestampCreates a timestamp from datetime and given time zone.
Format DatetimeFormats datetime to a string of a given format.
Timestamp to DatetimeConverts a timestamp to datetime.

Encoders and decoders

DirectiveDescription
DecodeDecodes a column value as one ofbase32,base64, orhex.
EncodeEncodes a column value as one ofbase32,base64, orhex.

Hashing and masking

DirectiveDescription
HashGenerates a message digest.
Mask NumberApplies substitution masking on the column values.
Mask ShuffleApplies shuffle masking on the column values.

Lookups

DirectiveDescription
Catalog LookupStatic catalog lookup of ICD-9, ICD-10-2016, and ICD-10-2017 codes.
Table LookupPerforms lookups into Table datasets.

Natural language processing

DirectiveDescription
Stemming Tokenized WordsApplies the Porter stemming algorithm for English words.

Output Formatters

DirectiveDescription
Write as CSVConverts a record into CSV format.
Write as JSON MapConverts 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.

Parsers

DirectiveDescription
JSON PathUses a DSL (a JSON path expression) for parsing JSON records.
Parse as AVRO FileParses an AVRO data file.
Parse as CSVParses an input record as comma-separated values
Parse as CurrencyParses a currency value that is a string representation of local currency into a number.
Parse as DatetimeParses string as datetime data type with a given format.
Parse as ExcelParses into a Microsoft Excel file.
Parse as Fixed LengthParses as a fixed length record with specified widths.
Parse as HL7Parses Health Level 7 Version 2 (HL7 V2) messages.
Parse as JSONParses a JSON object.
Parse as LogParses access log files, such as Apache httpd and NGINX servers.
Parse as Simple DateParses date strings.
Parse as TimestampParses column values representing unix timestamp as date.
Parse XML To JSONParses an XML document into a JSON structure.

Row operations

DirectiveDescription
Filter RowsFilters records based on a condition.
Filter Row if MatchedFilters rows that match a pattern for a column.
FlattenSeparates the elements in a repeated field.
Fail on conditionFails processing when the condition is evaluated to true.
Send to ErrorFilters records to an error collector.
Send to Error and Continue ProcessingFilters records to an error collector and continues processing.
Split to RowsSplits based on a separator into multiple records.

Transformations

DirectiveDescription
Changing CaseChanges the case of column values to uppercase or lowercase characters.
Create RecordCreates a record column with nested values by copying values from source columns into a destination column.
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.
QuantizationApplies quantization to column values.
Extract Regex GroupsExtracts the data from a group of regular expressions into its own column.
Set CharsetSets the encoding and then converts the data to a UTF-8 String.
Set Record DelimSets the record delimiter.
Split EmailSplits 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 theapplication/x-www-form-urlencoded MIME format.
URL EncodeEncodes to theapplication/x-www-form-urlencoded MIME format.
Trimming SpacesFunctions for trimming white spaces around string data.

Transient aggregators and setters

DirectiveDescription
Increment VariableIncrements a transient variable with a record of processing.
Set VariableSets a transient variable with a record of processing.

Unique ID

DirectiveDescription
Generate UUIDGenerates a universally unique identifier (UUID).

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-15 UTC.