1

Denodo custom Wrapper I am using below code, In the timestamp_field, timestamptz_field column is coming blank.

@Override
    public CustomWrapperSchemaParameter[] getSchemaParameters(
            Map<String, String> inputValues) {

        return new CustomWrapperSchemaParameter[] {

                new CustomWrapperSchemaParameter("date_field", java.sql.Types.DATE)
                , new CustomWrapperSchemaParameter("timestamp_field", java.sql.Types.TIMESTAMP)
                , new CustomWrapperSchemaParameter("timestamptz_field", java.sql.Types.TIMESTAMP_WITH_TIMEZONE)
                , new CustomWrapperSchemaParameter("time_field", java.sql.Types.TIME)
        };
    }
    @Override
    public void run(CustomWrapperConditionHolder condition,List<CustomWrapperFieldExpression> projectedFields,CustomWrapperResult result, Map<String,String> inputValues)
              throws CustomWrapperException {
        String strDatewithTime="2019-08-29 20:46:46.166666700";
        // TODO Auto-generated method stub
        int index = strDatewithTime.indexOf(".");
        if(index>0)
            {
            strDatewithTime= strDatewithTime.substring(0, index);
            }

        DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
         result.addRow(new Object[]{
                    LocalDate.parse("2017-10-11"),
                    LocalDateTime.parse(strDatewithTime,FORMATTER),
                    OffsetDateTime.parse("2015-03-08T01:59:59+01:00"),
                    LocalTime.parse("21:15:45")},
                    projectedFields);
    }
  1. to make this working, Do i need to change any settings?
  2. it's all hard coding, I don't think there is any code problem. This code is mention on below link https://community.denodo.com/docs/html/browse/7.0/vdp/developer/developing_extensions/developing_custom_wrappers/dealing_with_datetime_and_interval_types
Rahul Patel
  • 307
  • 1
  • 9
  • 27
  • I run your code with the latest update of Denodo 7.0 and worked well. All the fields return a value. – Montecarlo Oct 08 '19 at 05:16
  • @Montecarlo Yeah, It works in my local as well, not sure what's the issue in client Denodo environment. I have admin access to dev, You can tell me which configurations needs to check. I could go and check – Rahul Patel Oct 09 '19 at 07:31
  • try using the JDBC driver of the update you have installed on the Denodo server. – Montecarlo Oct 12 '19 at 03:53

1 Answers1

0

I have found the issue and resolved. Local VDP client needs some patches. Server vdp has installed some additional patches. Code was correct. After installing those patches, Data is coming up properly. I figure it out by looking into vdp admin each options. Thanks all of you for support.

Rahul Patel
  • 307
  • 1
  • 9
  • 27