expr
(FakeRel [])
----
fake-rel
 ├── cardinality: [0 - 0]
 ├── stats: [rows=0]
 └── cost: 0.01

expr
(FakeRel
  [
    (OutputCols [ (NewColumn "a" "int") (NewColumn "b" "int") (NewColumn "c" "int")] )
    (NotNullCols "a,b")
    (Cardinality "-")
  ]
)
----
fake-rel
 ├── columns: a:1(int!null) b:2(int!null) c:3(int)
 ├── stats: [rows=0]
 └── cost: 0.02

expr
(FakeRel
  [
    (OutputCols [ (NewColumn "a" "int") (NewColumn "b" "int") (NewColumn "c" "int")] )
    (Cardinality "5 - 1000")
    (stats `[
      {
        "columns": ["a"],
        "distinct_count": 100,
        "null_count": 0,
        "row_count": 100,
        "created_at": "2018-01-01 1:00:00.00000+00:00"
      },
      {
        "columns": ["b"],
        "distinct_count": 20,
        "null_count": 5,
        "row_count": 100,
        "created_at": "2018-01-01 1:00:00.00000+00:00"
      }
    ]`)
  ]
)
----
fake-rel
 ├── columns: a:1(int) b:2(int) c:3(int)
 ├── cardinality: [5 - 1000]
 ├── stats: [rows=100, distinct(1)=100, null(1)=0, distinct(2)=20, null(2)=5]
 └── cost: 0.01

# Verify that newer stats are preferred.
expr
(FakeRel
  [
    (OutputCols [ (NewColumn "a" "int") (NewColumn "b" "int") (NewColumn "c" "int")] )
    (Cardinality "-")
    (stats `[
      {
        "columns": ["a"],
        "distinct_count": 100,
        "null_count": 0,
        "row_count": 100,
        "created_at": "2018-01-01 1:00:00.00000+00:00"
      },
      {
        "columns": ["a"],
        "distinct_count": 110,
        "null_count": 0,
        "row_count": 110,
        "created_at": "2018-01-02 1:00:00.00000+00:00"
      },
      {
        "columns": ["b"],
        "distinct_count": 20,
        "null_count": 5,
        "row_count": 100,
        "created_at": "2018-01-01 1:00:00.00000+00:00"
      },
      {
        "columns": ["b"],
        "distinct_count": 22,
        "null_count": 5,
        "row_count": 120,
        "created_at": "2018-01-03 1:00:00.00000+00:00"
      }
    ]`)
  ]
)
----
fake-rel
 ├── columns: a:1(int) b:2(int) c:3(int)
 ├── stats: [rows=120, distinct(1)=110, null(1)=0, distinct(2)=22, null(2)=5]
 └── cost: 0.02
