Skip to content

Conversation

@russellwheatley
Copy link
Member

@russellwheatley russellwheatley commented Apr 9, 2020

fixes #250

  • The latest commit for the gen-schema-view uses the firestore-bigquery-change-tracker package script which is not specified in the package.json.

fixes #196

  • The RawChangelogViewSchema was not exported out of the firestore-bigquery-change-tracker package. This caused the fields property to be undefined at this point in the code.

Here's a screenshot of the gen-schema-view script working again:
Screenshot 2020-04-09 at 12 55 13

Please note that the gen-schema-view package will still not work until this PR has been merged and the firestore-bigquery-change-tracker & gen-schema-view packages have been published again.

@googlebot googlebot added the cla: yes Author has signed the CLA label Apr 9, 2020
@russellwheatley russellwheatley requested review from a team, Ehesp and Salakar April 9, 2020 12:11
@Salakar Salakar changed the title fix(firestore-bigquery-export): add & update mod fix(firestore-bigquery-export): add package & update exports Apr 9, 2020
@newadays
Copy link

newadays commented Apr 9, 2020

Thanks @russellwheatley Do we have update on merging the PR?

Copy link

@stari4ek stari4ek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

firestore-bigquery-change-tracker:^1.1.2 does not have RawChangelogViewSchema

@stari4ek
Copy link

stari4ek commented Apr 10, 2020

And since there is new dependency for firestore-bigquery-change-tracker DEVSETUP.md should be also updated

Copy link
Contributor

@laurenzlong laurenzlong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @russellwheatley ! Can you please

  • Increment version of firestore-bigquery-change-tracker (it should be 1.1.4 since I just published 1.1.3)
  • Increment version of gen-schema-view
  • Mark this PR as "ready for review" if it is ready to be merged and the packages are ready to be published?

@kiendt07
Copy link

Pls merge this PR soon 🙇‍♂️

@russellwheatley russellwheatley marked this pull request as ready for review April 14, 2020 15:12
@laurenzlong laurenzlong merged commit f7faed6 into next Apr 14, 2020
@laurenzlong laurenzlong deleted the @invertase/fix-bq-bugs branch April 14, 2020 19:50
@laurenzlong
Copy link
Contributor

firestore-bigquery-change-tracker and gen-schema-view have both been updated on NPM.

@sommes54
Copy link

sommes54 commented Apr 16, 2020

{ "fields": [ { "name": "main", "type": "string" }, { "name": "medium", "type": "string" }, { "name": "small", "type": "string" }, { "name": "thumbnail", "type": "string" } ], "name": "mainImage", "type": "map" },

ERROR
firestore_export.allProducts_schema_schema_changelog. Cannot add fields (field: mainImage_main)

I am not sure if this is caused by the change but map type is no longer working. @russellwheatley any thoughts?

@laurenzlong
Copy link
Contributor

laurenzlong commented Apr 16, 2020

If your Firestore document is structured like:

"mainImage": {
  "main": "url1",
  "small": "url2",
  "medium": "url3",
  "thumbnail": "url4"
}

Can you ensure your schema file is:

{
  "fields": [
    {
      "fields": [
 { "name": "main", "type": "string" }, { "name": "medium", "type": "string" }, { "name": "small", "type": "string" }, { "name": "thumbnail", "type": "string" }
      ],
      "name": "mainImage",
      "type": "map"
    }
  ]
}

Note the top level fields key, in addition to the nested fields key.

@newadays
Copy link

Thank you @laurenzlong. I tried to run with the format you shared with but it gave a different error.

{"code":400,"errors":[{"message":"Provided Schema does not match Table PROJECT_ID:firestore_export.allProducts_schema_schema_changelog. Cannot add fields (field: mainImage_main)","domain":"global","reason": "invalid"}],"message":"Provided Schema does not match Table PROJECT_ID:firestore_export.allProducts_schema_schema_changelog. Cannot add fields (field: mainImage_main)"} Provided Schema does not match Table PROJECT_ID:firestore_export.allProducts_schema_schema_changelog. Cannot add fields (field: mainImage_main)

It seems the script adds "_" whereas the schema generated from the Firestore export has the "." map notations e.g. mainImage.main is the correct field name where as "mainImage_main" does not exist. Is there a way to have the name generated by the firestore export.

@laurenzlong
Copy link
Contributor

Hi @newadays could you please file a new Github issue for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes Author has signed the CLA

Projects

None yet

8 participants