Uploaded image for project: 'Apache Hudi'
  1. Apache Hudi
  2. HUDI-723

SqlTransformer's schema sometimes is not registered.

    XMLWordPrintableJSON

Details

    Description

      If schema is inferred from RowBasedSchemaProvider when SQL transformer is used it also needs to be registered. 

       

      Current way only works if SchemaProvider has a valid target schema. Is one wants to use schema from SQL transformation, the result of RowBasedSchemaProvider.getTargetSchema needs to be passed into something like:

      private void setupWriteClient(SchemaProvider schemaProvider) {
        LOG.info("Setting up Hoodie Write Client");
        registerAvroSchemas(schemaProvider);
        HoodieWriteConfig hoodieCfg = getHoodieClientConfig(schemaProvider);
        writeClient = new HoodieWriteClient<>(jssc, hoodieCfg, true);
        onInitializingHoodieWriteClient.apply(writeClient);
      }
      

      Existent method will not work as it is checking for:

      if ((null != schemaProvider) && (null == writeClient)) {
      

      and writeClient is already configured. 

       

      Attachments

        Issue Links

          Activity

            People

              hongdongdong hong dongdong
              afilipchik Alexander Filipchik
              Votes:
              0 Vote for this issue
              Watchers:
              4 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 - 0.5h
                  0.5h