【问题标题】:Large dataset with incompatible data comparison across various databases大型数据集,不同数据库之间的数据比较不兼容
【发布时间】:2019-02-06 18:42:18
【问题描述】:

我们在 MySQL 和 Big Query 之间运行了同步管道, 我想比较一些关键表,但它们在百万行中相当大,每列多达 50 多列。 我曾尝试使用 CSV 转储,并以这种方式进行比较,但也存在数据类型不兼容问题(即日期表示)

如何进行大数据比较?

【问题讨论】:

    标签: mysql google-bigquery etl endly


    【解决方案1】:

    现在关于使用endly 比较任何数据库, where directives 部分允许指定索引表达式(唯一列组合)、所需的日期格式和其他比较选项。

    您可以简单地使用如下所示的简单工作流名称运行。

    endly -r=compare
    

    @compare.yaml

    pipeline:
      register:
        mysqldb:
          action: dsunit:register
            datastore: myMySQLdataset
            config:
              driverName: mysql
              descriptor: '[username]:[password]@tcp(127.0.0.1:3306)/[dbname]?parseTime=true'
              parameters:
                dbname: myMySQLdataset
                username: myUsername
                password: myPassowrd
    
        bigquerydb:
          action: dsunit:register
          datastore: myBQdataset
          config:
            driverName: bigquery
            parameters:
              datasetId: myBQdataset
    
      compare:
        action: dsunit:compare
        maxRowDiscrepancy: 1000000
    
        directives:
          "@indexBy@": id,otherUniqueColumn
          "@numericPrecisionPoint@": 7
          "@coalesceWithZero@": true
          "@caseSensitive@": false
          "@timeFormat@myDateColumn": 'yyyy-MM-dd'
        source1:
          datastore: myMySQLdataset
          SQL: SELECT *
               FROM table1
    
        source2:
          datastore: myBQdataset
          SQL: SELECT *
               FROM table1
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多