Skip to content

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

Closed

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_name → new_name
  • old_value → new_value

Add prefix to all fields:

... | rename * AS user_*
  • id → user_id
  • email → user_email
  • status → user_status

Remove suffix from field names:

... | rename *_field AS *
  • name_field → name
  • date_field → date

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

PPLenhancementv3.3.0

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions