[jira] [Commented] (CARBONDATA-37) Support Date/Time format for Timestamp columns to be defined at column level

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (CARBONDATA-37) Support Date/Time format for Timestamp columns to be defined at column level

Akash R Nilugal (Jira)

    [ https://issues.apache.org/jira/browse/CARBONDATA-37?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15607189#comment-15607189 ]

ASF GitHub Bot commented on CARBONDATA-37:
------------------------------------------

Github user QiangCai commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/219#discussion_r85039860
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/keygenerator/directdictionary/timestamp/TimeStampDirectDictionaryGenerator.java ---
    @@ -39,37 +39,32 @@
      */
     public class TimeStampDirectDictionaryGenerator implements DirectDictionaryGenerator {
     
    -  private TimeStampDirectDictionaryGenerator() {
    +  private ThreadLocal<SimpleDateFormat> threadLocal = new ThreadLocal<>();
     
    -  }
    -
    -  public static TimeStampDirectDictionaryGenerator instance =
    -      new TimeStampDirectDictionaryGenerator();
    +  private String dateFormat;
     
       /**
        * The value of 1 unit of the SECOND, MINUTE, HOUR, or DAY in millis.
        */
    -  public static final long granularityFactor;
    +  public  long granularityFactor;
       /**
        * The date timestamp to be considered as start date for calculating the timestamp
        * java counts the number of milliseconds from  start of "January 1, 1970", this property is
        * customized the start of position. for example "January 1, 2000"
        */
    -  public static final long cutOffTimeStamp;
    +  public  long cutOffTimeStamp;
       /**
        * Logger instance
        */
    +
       private static final LogService LOGGER =
    -      LogServiceFactory.getLogService(TimeStampDirectDictionaryGenerator.class.getName());
    +          LogServiceFactory.getLogService(TimeStampDirectDictionaryGenerator.class.getName());
     
    -  /**
    -   * initialization block for granularityFactor and cutOffTimeStamp
    -   */
    -  static {
    +  public TimeStampDirectDictionaryGenerator(String dateFormat) {
    --- End diff --
   
    please keep default dateformat TimeStampDirectDictionaryGenerator() construct method, If DataLoading command didn't provide dateformat option for some column, we can use none-parameter construct method.


> Support Date/Time format for Timestamp columns to be defined at column level
> ----------------------------------------------------------------------------
>
>                 Key: CARBONDATA-37
>                 URL: https://issues.apache.org/jira/browse/CARBONDATA-37
>             Project: CarbonData
>          Issue Type: Improvement
>            Reporter: Vimal Das Kammath
>            Assignee: Lionx
>
> Carbon support defining the Date/Time format. But the configuration for the same is present in carbon.properties and hence is global for all tables.
> This global configuration for timestamp format cannot support scenarios where different tables or different Timestamp columns in the same table.
> Suggest to provide option in the create table DDL itself to define the format for each Timestamp column. Also provide defaults so that users can create table with Timestamp columns without having to always define the Date/Time format.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)