Hi!
I would like to report a bug when trying to ask custom questions using join.
I have received the error message ORA-00972: identifier is too long.
Analyzing the log, I realized that the tool is passing the nickname of the table and columns in the join instead of the correct nomenclature.
can you help me?
Hi @thales.dias
Please post âDiagnostic Infoâ from Admin > Troubleshooting, and which version of ojdbc8.jar you are using
The actual query would be helpful to understand the problem too.
Sounds like itâs something like this: https://stackoverflow.com/questions/3085562/ora-00972-identifier-is-too-long-alias-column-name
{
âbrowser-infoâ: {
âlanguageâ: âpt-BRâ,
âplatformâ: âWin32â,
âuserAgentâ: âMozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36â,
âvendorâ: âGoogle Inc.â
},
âsystem-infoâ: {
âfile.encodingâ: âUTF-8â,
âjava.runtime.nameâ: âJava⢠SE Runtime Environmentâ,
âjava.runtime.versionâ: â1.8.0_212-b10â,
âjava.vendorâ: âOracle Corporationâ,
âjava.vendor.urlâ: âhttp://java.oracle.com/â,
âjava.versionâ: â1.8.0_212â,
âjava.vm.nameâ: âJava HotSpot⢠64-Bit Server VMâ,
âjava.vm.versionâ: â25.212-b10â,
âos.nameâ: âLinuxâ,
âos.versionâ: â3.10.0-1160.6.1.el7.x86_64â,
âuser.languageâ: âenâ,
âuser.timezoneâ: âAmerica/Sao_Pauloâ
},
âmetabase-infoâ: {
âdatabasesâ: [
âoracleâ
],
âhosting-envâ: âunknownâ,
âapplication-databaseâ: âmysqlâ,
âapplication-database-detailsâ: {
âdatabaseâ: {
ânameâ: âMariaDBâ,
âversionâ: â10.5.8-MariaDBâ
},
âjdbc-driverâ: {
ânameâ: âMariaDB Connector/Jâ,
âversionâ: â2.6.2â
}
},
ârun-modeâ: âprodâ,
âversionâ: {
âtagâ: âv0.37.4â,
âdateâ: â2020-12-17â,
âbranchâ: ârelease-x.37.xâ,
âhashâ: âe0d5287â
},
âsettingsâ: {
âreport-timezoneâ: null
}
}
}
Hi!
The query I cannot post, it is outside the companyâs rules, but basically the table is named DIM_TEMPO and the alias of DIM TEMPO.
When I make a query the metabase is considering DIM TEMPO and not DIM_TEMPO.
This means that the alias I entered in the metabase is considered in the column and not the real name. The alias is large and therefore the error occurs.
@thales.dias Then create a sample schema, which you can share, and with steps-to-reproduce.
Itâs really difficult to help without much information.
Hi!
This is an example of a query. The time dimension he interprets with the wrong name
SELECT *
SELECT *
FROM (SELECT
âBI_SCHEMAâ.âFAT_RMNâ.âVLR_RMN_BRUTAâ AS âVLR_RMN_BRUTAâ,
âBI_SCHEMAâ.âFAT_RMNâ.âVLR_RMN_LIQUIDAâ AS âVLR_RMN_LIQUIDAâ,
âDIMENSĂO TEMPO - CĂDIGO IDENTIFICADOR DA DATA DO PAGAMENTOâ.âSEQ_DIM_TEMPOâ AS âSEQ_DIM_TEMPOâ,
âDIMENSĂO TEMPO - CĂDIGO IDENTIFICADOR DA DATA DO PAGAMENTOâ.âDAT_DATAâ AS âDAT_DATAâ,
âDIMENSĂO TEMPO - CĂDIGO IDENTIFICADOR DA DATA DO PAGAMENTOâ.âNUM_ANOâ AS âNUM_ANOâ,
FROM âBI_SCHEMAâ.âFAT_RMNâ
LEFT JOIN âBI_SCHEMAâ.âDIM_TEMPOâ âDIMENSĂO TEMPO - CĂDIGO IDENTIFICADOR DA DATA DO PAGAMENTOâ
ON âBI_SCHEMAâ.âFAT_RMNâ.âSEQ_DAT_PAGAMENTOâ =
âDIMENSĂO TEMPO - CĂDIGO IDENTIFICADOR DA DATA DO PAGAMENTOâ.âSEQ_DIM_TEMPOâ
WHERE (âDIMENSĂO TEMPO - CĂDIGO IDENTIFICADOR DA DATA DO PAGAMENTOâ.âNUM_ANOâ = 2020 AND
âDIMENSĂO TEMPO - CĂDIGO IDENTIFICADOR DA DATA DO PAGAMENTOâ.âNUM_MESâ = 11))
WHERE ROWNUM <= 2000
@thales.dias I donât understand what the problem is, but it looks like you are hitting a limitation on Oracle, because you have created very long names for your tables in Metabase. Change the names to something shorter in Admin > Data Model.
Hi!
I believe this is not the problem, when I reverse the order of the joins in some cases it works.
It seems that METABASE is not accepting that the table of values ââis the first table selected in the custom question.
Anyway, I will reduce the names to try to solve the problem.
Thanks!
Hi!
I will add the images here for easy understanding.
When I reverse the order of the join, METABASE understands without giving the error mentioned.
I'm finding it strange for that.
First attempt using the table of values ââas the starting table.
- Which version of Oracle are you using?
- Which version of ojdbc8.jar are you using?
- Please post the query of the âsecond attemptâ, where it works
I identified that the problem appears to be in the friendly name.
Even disabled, it continues passing the friendly name in the query execution.
@thales.dias When you disable Friendly Names, then it does a resync of all your data, which might take a while (see Admin > Troubleshooting > Logs) and it might require that you refresh your browser too, so you see the update names.
I donât understand what the problem is, since you are not providing the queries that work vs the ones that doesnât work for comparison.
Hi, iâm facing the same issue. Given the join order, the issue pops ups or not.
Query 1 : fails
SELECT âHELIOSâ.âSWINTRANS_V_F_OTâ.âCODE_EXPEDITEURâ AS âCODE_EXPEDITEURâ, count(*) AS âcountâ
FROM âHELIOSâ.âSWINTRANS_V_F_OTâ
LEFT JOIN âHELIOSâ.âSWINTRANS_V_F_ELTS_FACT_VENTEâ âSwi Ntr Ans V F El Ts Fact Venteâ ON âHELIOSâ.âSWINTRANS_V_F_OTâ.âNO_LIGNE_COMMANDEâ = âSwi Ntr Ans V F El Ts Fact Venteâ.âNO_LIGNE_COMMANDEâ
GROUP BY âHELIOSâ.âSWINTRANS_V_F_OTâ.âCODE_EXPEDITEURâ
Error : "ORA-00972: identifier is too long"
Query 2 : succeeds
SELECT âSWINTRANS_V_F_OTâ.âCODE_EXPEDITEURâ AS âCODE_EXPEDITEURâ, count(*) AS âcountâ
FROM âHELIOSâ.âSWINTRANS_V_F_ELTS_FACT_VENTEâ
LEFT JOIN âHELIOSâ.âSWINTRANS_V_F_OTâ âSWINTRANS_V_F_OTâ ON âHELIOSâ.âSWINTRANS_V_F_ELTS_FACT_VENTEâ.âNO_LIGNE_COMMANDEâ = âSWINTRANS_V_F_OTâ.âNO_LIGNE_COMMANDEâ
GROUP BY âSWINTRANS_V_F_OTâ.âCODE_EXPEDITEURâ
Any idea of the cause or any workaround ?
==[ Environment ]===========================
{
âbrowser-infoâ: {
âlanguageâ: âfrâ,
âplatformâ: âMacIntelâ,
âuserAgentâ: âMozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36â,
âvendorâ: âGoogle Inc.â
},
âsystem-infoâ: {
âfile.encodingâ: âCp1252â,
âjava.runtime.nameâ: âJava⢠SE Runtime Environmentâ,
âjava.runtime.versionâ: â1.8.0_65-b17â,
âjava.vendorâ: âOracle Corporationâ,
âjava.vendor.urlâ: âhttp://java.oracle.com/â,
âjava.versionâ: â1.8.0_65â,
âjava.vm.nameâ: âJava HotSpot⢠64-Bit Server VMâ,
âjava.vm.versionâ: â25.65-b01â,
âos.nameâ: âWindows Server 2012 R2â,
âos.versionâ: â6.3â,
âuser.languageâ: âfrâ,
âuser.timezoneâ: âEurope/Parisâ
},
âmetabase-infoâ: {
âdatabasesâ: [
âh2â,
âoracleâ
],
âhosting-envâ: âunknownâ,
âapplication-databaseâ: âh2â,
âapplication-database-detailsâ: {
âdatabaseâ: {
ânameâ: âH2â,
âversionâ: â1.4.197 (2018-03-18)â
},
âjdbc-driverâ: {
ânameâ: âH2 JDBC Driverâ,
âversionâ: â1.4.197 (2018-03-18)â
}
},
ârun-modeâ: âprodâ,
âversionâ: {
âtagâ: âv0.37.5â,
âdateâ: â2021-01-05â,
âbranchâ: ârelease-x.37.xâ,
âhashâ: âbe537eeâ
},
âsettingsâ: {
âreport-timezoneâ: null
}
}
}
@Francois_data This is a limitation of Oracle < 12.2. You can disable Friendly Name:
https://www.metabase.com/docs/latest/administration-guide/08-configuration-settings.html#friendly-table-and-field-names
You should migrate away from H2 if youâre using Metabase in production:
https://www.metabase.com/docs/latest/operations-guide/migrating-from-h2.html
And you should update Java:
https://www.metabase.com/docs/latest/operations-guide/java-versions.html
Hi!
Disabling friendly names did not solve my problem. Neither does updating java.
@thales.dias
This is a limitation of Oracle < 12.2
Post âDiagnostic Infoâ from Admin > Troubleshooting.
And the version of ojdbc8.jar
Hi!
I am still facing a problem in METABASE with customized questions.
When I use join in custom questions, METABASE cannot understand that the real name of the table and field should be given to the query and not the friendly name.
METABASE diagnostic information data is:
{
"browser-info": {
"language": "pt-BR",
"platform": "Win32",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36",
"vendor": "Google Inc."
},
"system-info": {
"file.encoding": "UTF-8",
"java.runtime.name": "Java(TM) SE Runtime Environment",
"java.runtime.version": "1.8.0_212-b10",
"java.vendor": "Oracle Corporation",
"java.vendor.url": "http://java.oracle.com/",
"java.version": "1.8.0_212",
"java.vm.name": "Java HotSpot(TM) 64-Bit Server VM",
"java.vm.version": "25.212-b10",
"os.name": "Linux",
"os.version": "3.10.0-1160.15.2.el7.x86_64",
"user.language": "en",
"user.timezone": "America/Sao_Paulo"
},
"metabase-info": {
"databases": [
"oracle"
],
"hosting-env": "unknown",
"application-database": "mysql",
"application-database-details": {
"database": {
"name": "MariaDB",
"version": "10.5.8-MariaDB"
},
"jdbc-driver": {
"name": "MariaDB Connector/J",
"version": "2.6.2"
}
},
"run-mode": "prod",
"version": {
"tag": "v0.38.0",
"date": "2021-02-16",
"branch": "release-x.38.x",
"hash": "471aa51"
},
"settings": {
"report-timezone": null
}
}
}
When I join the error returned is:
Analyzing the log file, the query is being executed as follows:
SELECT *
FROM (SELECT BI_SICOM.TBLAUXEMP.CODACP AS CODACP,
BI_SICOM.TBLAUXEMP.CODMUN AS CODMUN,
BI_SICOM.TBLAUXEMP.CODORG AS CODORG,
BI_SICOM.TBLAUXEMP.DATCRG AS DATCRG,
BI_SICOM.TBLAUXEMP.NUMANOMESREF AS NUMANOMESREF,
BI_SICOM.TBLAUXEMP.NUMANOREF AS NUMANOREF,
BI_SICOM.TBLAUXEMP.NUMMESREF AS NUMMESREF,
BI_SICOM.TBLAUXEMP.SEQEMP AS SEQEMP,
BI_SICOM.TBLAUXEMP.SEQORG AS SEQORG,
BI_SICOM.TBLAUXEMP.VLRANLEMPFNTRER AS VLRANLEMPFNTRER,
BI_SICOM.TBLAUXEMP.VLRANLLQDEMPFNTRER AS VLRANLLQDEMPFNTRER,
BI_SICOM.TBLAUXEMP.VLRANLOTRBXAEMPFNTRER AS VLRANLOTRBXAEMPFNTRER,
BI_SICOM.TBLAUXEMP.VLRANLPAGEMPFNTRER AS VLRANLPAGEMPFNTRER,
BI_SICOM.TBLAUXEMP.VLREMPFNTRER AS VLREMPFNTRER,
BI_SICOM.TBLAUXEMP.VLRLQDEMPFNTRER AS VLRLQDEMPFNTRER,
BI_SICOM.TBLAUXEMP.VLROTRBXAEMPFNTRER AS VLROTRBXAEMPFNTRER,
BI_SICOM.TBLAUXEMP.VLRPAGEMPFNTRER AS VLRPAGEMPFNTRER,
BI_SICOM.TBLAUXEMP.VLRRFCEMPFNTRER AS VLRRFCEMPFNTRER,
TABELA ĂRGĂO - CĂDIGO IDENTIFICADOR DO ĂRGĂO.SEQORG AS identifier_wyquqxrxv,
TABELA ĂRGĂO - CĂDIGO IDENTIFICADOR DO ĂRGĂO.DATATL AS identifier_nruzyqvxtus,
TABELA ĂRGĂO - CĂDIGO IDENTIFICADOR DO ĂRGĂO.DATCRA AS identifier_rzxrvuvvtt,
TABELA ĂRGĂO - CĂDIGO IDENTIFICADOR DO ĂRGĂO.DATEXO AS identifier_nrutqxwxswt,
TABELA ĂRGĂO - CĂDIGO IDENTIFICADOR DO ĂRGĂO.DATINI AS identifier_nsqxxwssvvy,
TABELA ĂRGĂO - CĂDIGO IDENTIFICADOR DO ĂRGĂO.DATPUBEXO AS identifier_nrwwsytuszs,
TABELA ĂRGĂO - CĂDIGO IDENTIFICADOR DO ĂRGĂO.CODMUN AS identifier_uxwxqqxut,
TABELA ĂRGĂO - CĂDIGO IDENTIFICADOR DO ĂRGĂO.CODMUNSIC AS identifier_nxqquxyqty,
TABELA ĂRGĂO - CĂDIGO IDENTIFICADOR DO ĂRGĂO.CODORG AS identifier_rvquzwwrsq,
TABELA ĂRGĂO - CĂDIGO IDENTIFICADOR DO ĂRGĂO.CODTPOORG AS identifier_wrwxtqzts,
TABELA ĂRGĂO - CĂDIGO IDENTIFICADOR DO ĂRGĂO.DSCEML AS identifier_nvqzvwxuqq,
TABELA ĂRGĂO - CĂDIGO IDENTIFICADOR DO ĂRGĂO.DSCTPOORG AS identifier_nrruxzsrwux,
TABELA ĂRGĂO - CĂDIGO IDENTIFICADOR DO ĂRGĂO.NOMORG AS identifier_tuuqwywtq,
TABELA ĂRGĂO - CĂDIGO IDENTIFICADOR DO ĂRGĂO.NUMCGCORG AS identifier_nsxxytxwss,
TABELA ĂRGĂO - CĂDIGO IDENTIFICADOR DO ĂRGĂO.NUMLEICRA AS identifier_yztvtttvs,
TABELA ĂRGĂO - CĂDIGO IDENTIFICADOR DO ĂRGĂO.NUMLEIEXO AS identifier_usrqwvyru,
TABELA ĂRGĂO - CĂDIGO IDENTIFICADOR DO ĂRGĂO.NUMTEL AS identifier_nryxszvxqxr
FROM BI_SICOM.TBLAUXEMP
LEFT JOIN BI_SICOM.ODSORG identifier_ntwuvvtytv ON BI_SICOM.TBLAUXEMP.SEQORG = TABELA ĂRGĂO - CĂDIGO IDENTIFICADOR DO ĂRGĂO.SEQORG
)
WHERE rownum <= 2000;
The ĂRGĂO table is being interpreted by the friendly name together with the name of your entity key and not by the real name.
Even disabling friendly names, the problem still persists.
I wonder if anyone else is experiencing this problem and if they have already found the solution.
Thanks!
- Which version of ojdbc8.jar are you using?
- Which version of Oracle Server are you using?
- You should upgrade your Java version: https://www.metabase.com/docs/latest/operations-guide/java-versions.html
I donât understand what you mean. If you have disabled Friendly Names, then perhaps you have given the table a custom name in Admin > Data Model.
That took a while to figure out what was going on - I have created an issue about this:
https://github.com/metabase/metabase/issues/15978 - upvote by clicking on the first post