Skip to content

[FEATURE] Enhance PPL rename command to support wildcards #4008

@ritvibhatt

Description

@ritvibhatt

Enhance Rename Command with Wildcard Support in PPL

Description

This RFC proposes enhancing the existing rename command in PPL to add support for wildcards

Usage Examples

Rename fields with "old" prefix to "new":

... | rename old_* AS new_*
  • old_namenew_name
  • old_valuenew_value

Add prefix to all fields:

... | rename * AS user_*
  • iduser_id
  • emailuser_email
  • statususer_status

Remove suffix from field names:

... | rename *_field AS *
  • name_fieldname
  • date_fielddate

Implementation Details

  • Leverage existing grammar support for wildcard expressions (wcFieldExpression) in rename clauses
  • Extend rename processing logic to handle wildcard patterns during analysis phase
  • Maintain backward compatibility with existing literal field renaming
  • Source field and target field must have same number of wildcards

Metadata

Metadata

Assignees

Labels

PPLPiped processing languageenhancementNew feature or requestv3.3.0

Type

No type

Projects

Status

New

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions