Is it possible to use stream maps to rename a fiel...
# troubleshooting
s
Is it possible to use stream maps to rename a field in a stream? For example I would like to rename a field called
type
to
entity_type
. Motivation for this is it seems like when running discovery of the schema the field called
type
throws an error perhaps because type is already a reserved word in the schema spec. Did some testing and found that if I manually change the field name in the source (s3 jsonl) the tap runs as expected.
r
Yeah, should be possible - something like:
Copy code
stream_maps:
  entity_type:
    __source__: type
  type: null
Unsure if defined order is important here.
Actually, it might be simpler:
Copy code
stream_maps:
  type:
    __alias__: entity_type
https://sdk.meltano.com/en/latest/stream_maps.html#aliasing-a-stream-using-alias
s
hmm that seems to rename the entire stream? What if I wanted to rename a column/field within a stream? I tried something like this:
Copy code
stream_maps:
  my_stream:
    type:
      __alias__: entity_type
But didn't seem to rename that column
r
Oh my bad, I didn't read your post very well. 😅 Try this:
Copy code
stream_maps:
  my_stream:
    entity_type: type
    type: null