precision and scale not supported for DECIMAL type
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 52/100
Research direction
Start in pyhive/sqlalchemy_hive.py at the HiveTypeCompiler implementation linked in the issue, then inspect how SQLAlchemy NUMERIC types expose precision and scale. Confirm that DECIMAL/NUMERIC output preserves the unspecified, precision-only, and precision-and-scale cases described in the issue.
Written by the indexing model from the issue text.
Description
The current implementation of DECIMAL (/NUMERIC) does not support the precision and scale attribute which is supported since hive 0.13.
possible implementation solution:
class HiveTypeCompiler(compiler.GenericTypeCompiler):
# [..]
def visit_NUMERIC(self, type_):
precision = getattr(type_, "precision", None)
if precision is None:
return "DECIMAL"
else:
scale = getattr(type_, "scale", None)
if scale is None:
return "DECIMAL(%(precision)s)" % {"precision": precision}
else:
return "DECIMAL(%(precision)s, %(scale)s)" % {"precision": precision, "scale": scale}
- Dominant language
- Python
- Stars
- 1.7k
- Forks
- 545
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dropbox/PyHive
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100