Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Name_mappings: empty entityid in mappings provokes double "__" #2139

Closed
manucarrace opened this issue Feb 28, 2022 · 2 comments
Closed

Name_mappings: empty entityid in mappings provokes double "__" #2139

manucarrace opened this issue Feb 28, 2022 · 2 comments

Comments

@manucarrace
Copy link
Collaborator

Lets assume we have the folowing mapping for postgis sink:

{
  "serviceMappings": [
    {
      "originalService": "alcobendas",
      "newService": "alcobendas",
      "servicePathMappings": [
        {
          "originalServicePath": "/eficienciaenergetica",
          "newServicePath": "/",
          "entityMappings": [
            {
              "originalEntityId": "(.+)",
              "newEntityId": "",
              "originalEntityType": "ACMeasurement",
              "newEntityType": "acmeasurement",
              "attributeMappings": []
            },
...

According to the data models dm-by-entity-id, dm-by-entity-database and dm-by-entity-database-schema, the mapped table will be "eficienciaenergetica__acmeasurement"

It would be nice to have the following table name: "eficienciaenergetica_acmeasurement"

Note that if newServicePath is "" or newEntityType is "" the mapping does not add aditional underscore at the beggininf or end of the tabla name.

@AlvaroVega
Copy link
Member

According with the namemapping provided as example the table name will be "alcobendas_acmeasurement", won't be?

@AlvaroVega
Copy link
Member

AlvaroVega commented Mar 1, 2022

I seems that the right namemapping should be

{
  "serviceMappings": [
    {
      "originalService": "alcobendas",
      "newService": "",
      "servicePathMappings": [
        {
          "originalServicePath": "/eficienciaenergetica",
          "newServicePath": "/eficienciaenergetica",
          "entityMappings": [
            {
              "originalEntityId": "(.+)",
              "newEntityId": "",
              "originalEntityType": "ACMeasurement",
              "newEntityType": "acmeasurement",
              "attributeMappings": []
            },

and then tablename will be table name: "eficienciaenergetica_acmeasurement"

@fgalan fgalan added this to the release/2.17.0 milestone Mar 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants