Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-4841

Support decimal column type in CSV and File adapter

    XMLWordPrintableJSON

Details

    Description

      Currently, the csv adapter does not support the decimal/numeric column type (see supported types in CsvFieldType. Any type that is not supported will be interpreted by the CsvEnumerator as string.

      When dealing with decimal numbers, the currently most appropriate type is `double`. However, this is not accurate enough for financial data. This feature request proposes adding a `decimal` column type that will be implemented by the Java `BigDecimal` type (and by conversion in JavaToSqlTypeConversionRules be represented as a `Decimal` SQL type). This allow financial data to be represented and computed more accurately (`BigDecimal` has higher precision than `double`).

      Please see sample implementation in PR.

      Context: I am trying to leverage Calcite to add some SQL support to ledger reporting.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              lllouiskuang Louis Kuang
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 3h 20m
                  3h 20m