apache / apache/iceberg-python
Add `CAST` to `parser.py`
- Linguagem predominante
- Python
- Estrelas
- 1.1k
- Forks
- 581
- Merge médio
- 1d 13h
- PRs com merge (30d)
- 76
Descrição
### Feature Request / Improvement
I think I have somewhat of an idea on how to do this, so far have added the following to `parser.py`:
```py
CAST = CaselessKeyword("cast")
cast_expression = (CAST + "(" + column + "as" + identifier + Suppress(")")).set_results_name("cast")
# would need something special for the set_parse_action
```
I am wondering a couple of things:
Do we need a new class `CastableReference` or something? Worth expanding on the `Reference` class? And once that is done, how would we propagate the new type (Im assuming we need some way to go from a string to an `IcebergType` of the string the user has put into the cast operation) into the scan?
This was spawned from https://github.com/apache/iceberg-python/issues/170
Happy to work on this, just would be awesome to get some context
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Direção de pesquisa
Comece com parser.py e o contexto da issue 170. Rastreie a classe Reference existente e as ações de parsing; em seguida, acompanhe como as expressões analisadas chegam ao scan e como as strings se tornam valores de IcebergType. Está concluído quando a sintaxe CAST for analisada e seu tipo de destino for propagado para o scan.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- python
- Domínio
- databases
- Tipo de issue
- Funcionalidade
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Status de atividade
- Ativa
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 45/100