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

Cleanup : Schema Matcher and MatcherFactory code consolidation

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • 2.0.0
    • None
    • 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

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

            Dates

              Created:
              Updated: