public AdditionalSQLHashRecordMatcher(string[] srcTables, ComparisonData data, DB db)
        {
            this.srcTables = srcTables;
            this.db        = db;
            this.data      = data;

            TurnKeyColumnsToIndices(data.additionalKeyColumns);
        }
Ejemplo n.º 2
0
        public HashExporter(RecordReader reader, RecordWriter writer, ComparisonData data)
        {
            this.reader = reader;
            this.data   = data;
            TurnKeyColumnsToIndices(data.keyColumns);

            md5         = MD5.Create();
            this.writer = writer;
        }
Ejemplo n.º 3
0
        public MatchedRecordComparer(ComparisonData data, RoundingSettings settings, DiscrepancyOutputter outputter)
        {
            List <int> list = new List <int>();

            foreach (string ignoredColumn in data.ignoredColumns)
            {
                list.Add(XLSXUtils.CellReferenceToColumnIndex(ignoredColumn));
            }
            ignoredColumnIndices = list.ToArray();

            this.settings  = settings;
            this.outputter = outputter;
        }
Ejemplo n.º 4
0
 public SQLComparer(
     string connectionString,
     string connStr1,
     string query1,
     string connStr2,
     string query2,
     ComparisonData data,
     RoundingSettings settings) : base(connectionString, data, settings)
 {
     this.connStr1 = connStr1;
     this.query1   = query1;
     this.connStr2 = connStr2;
     this.query2   = query2;
 }
Ejemplo n.º 5
0
        public Comparer(string connectionString, ComparisonData comparisonData, RoundingSettings roundingSettings)
        {
            this.connectionString = connectionString;
            this.comparisonData   = comparisonData;
            this.roundingSettings = roundingSettings;

            matcher = new SQLHashRecordMatcher(
                new string[] {
                TABLE_NAME_ONE,
                TABLE_NAME_TWO
            },
                connectionString,
                comparisonData,
                roundingSettings);
        }
Ejemplo n.º 6
0
        public SQLHashRecordMatcher(string[] srcTables, string connectionString, ComparisonData data, RoundingSettings settings)
        {
            this.srcTables = srcTables;
            this.data      = data;
            this.settings  = settings;

            db = new SqlServerDB(connectionString);
            db.Connect();

            db.Query(@"
                IF OBJECT_ID('dbo.table1', 'U') IS NOT NULL 
                DROP TABLE dbo.table1; 

                IF OBJECT_ID('dbo.table2', 'U') IS NOT NULL 
                DROP TABLE dbo.table2; 
            ");
        }
Ejemplo n.º 7
0
        public void Extract(out TableData data)
        {
            data = new TableData();
            string[] record;

            // Skip records.
            for (int i = 0; i < idOffset - 1; i++)
            {
                reader.ReadNextRecord(out record);
            }

            int recordCounter = 0;

            while (reader.ReadNextRecord(out record))
            {
                // Skip header and record column count.
                if (recordCounter == 0)
                {
                    data.header = record;
                    recordCounter++;

                    int columnCount = record.Length;
                    writer.CreateFields(columnCount + ADDITIONAL_COLUMNS_COUNT);
                    data.columnCount = columnCount;

                    continue;
                }

                string[] hashedRecord = BuildHashedRecord(record);
                writer.Write(hashedRecord.ToArray());
                recordCounter++;
                if (recordCounter % 1000 == 0)
                {
                    Console.WriteLine("Extracted {0} rows.", recordCounter);
                }
            }
            reader.Close();

            data.recordCount = recordCounter;
        }
Ejemplo n.º 8
0
 public XLSXComparer(string[] filePaths, string[] sheetNames, string connectionString, ComparisonData data, RoundingSettings settings) : base(connectionString, data, settings)
 {
     this.filePaths  = filePaths;
     this.sheetNames = sheetNames;
     this.data       = data;
 }