Uploaded image for project: 'Sqoop'
  1. Sqoop
  2. SQOOP-1986 Sqoop2: Schema matching improvements
  3. SQOOP-2009

Cleanup : Schema Matcher and MatcherFactory code consolidation

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 2.0.0
    • Component/s: None
    • Labels:
      None

      Description

      Currently there is some logic in Schema Matcher constructor and some logic in MatcherFactory to set up the correct instance of matcher to use.

      These rules should be consolidated in one place in MatcherFactory so its less confusing to infer what values for from and to schema go into the concrete matcher implementations

      public class MatcherFactory {
        public static Matcher getMatcher(Schema fromSchema, Schema toSchema) {
          if (toSchema.isEmpty() || fromSchema.isEmpty()) {
            return new LocationMatcher(fromSchema, toSchema);
          } else {
            return new NameMatcher(fromSchema, toSchema);
          }
        }
      }
      
      

      public Matcher(Schema fromSchema, Schema toSchema) {
      if (fromSchema.isEmpty() && toSchema.isEmpty())

      { this.fromSchema = ByteArraySchema.getInstance(); this.toSchema = ByteArraySchema.getInstance(); }

      else if (toSchema.isEmpty())

      { this.fromSchema = fromSchema; this.toSchema = fromSchema; }

      else if (fromSchema.isEmpty())

      { this.fromSchema = toSchema; this.toSchema = toSchema; }

      else

      { this.fromSchema = fromSchema; this.toSchema = toSchema; }

      }

      
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              vybs Veena Basavaraj
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: