Apply database comments from tables and columns as labels in Yellowfin view

Mandy Howard shared this idea 6 years ago
Completed

All tables and columns in our databases (Postgres) have comments applied. These comments need to be applied as labels within the Yellowfin view to better enable users when creating reports. I noticed when creating a view that the column name is used as the label by default. This means we have to manually re-label hundreds of fields. It would be great if the view creation step leveraged any comments from the source database. Or at least have the option to do so.

Replies (3)

photo
1

Hi Mandy,


I'm unaware of a 'comments' type of label for Postgre columns, are you able to clarify how you use this? I'm just worried we may be using different terminology and will help me understand if what you're after is something that would be a feasible YF change, or if there is not an easy way to achieve this already.


Thanks,

David

photo
1

Hi David, you can see this in Postgres docs here. Specifically, comment on column and table. An example would be a table name "sales2017" and the comment on the table might be "Sales 2017." We have comments on all tables and columns. The comment is used as the label for end users in our application. I hope this helps.

photo
1

Thanks Mandy.

I've raised a task, though unfortunately this does not seem like it's something we can easily support, as it involves changes to our underlying view builder, and to only be supported by Postgres.

The alternative is to update your view fields via a DB script, though it may actually be same amount of effort as manually updating via the UI.


Our thought behind the view builder is that you build it once, and then it's done. So in your case it would be time consuming, but should only need to happen once.


Regards,

David

photo
2

Hi David,


If I understand correctly, the COMMENT concept in Postgres is stored in the pg_description system catalog table [1] and this is then surfaced via the standard JDBC DatabaseMetadata.getTables and getColumns methods as REMARKS [2][3].


Someone with access, has to look at Yellowfin source code to ensure it uses standard JDBC.


If this is confirmed, then the solution is generic to any JDBC compliant database...specifically, use the table/column REMARKS as label, if it is defined and fall back to table/column name otherwise (current behavior). There is nothing PostgresSQL specific in this case.


Please confirm this makes sense.


Thanks,


Jijoe


[1] - https://www.postgresql.org/docs/current/static/catalog-pg-description.html

[2] - http://docs.oracle.com/javase/8/docs/api/java/sql/DatabaseMetaData.html#getTables-java.lang.String-java.lang.String-java.lang.String-java.lang.String:A-

[3] - https://github.com/pgjdbc/pgjdbc/blob/master/pgjdbc/src/main/java/org/postgresql/jdbc/PgDatabaseMetaData.java#L1219

photo
1

Thanks Jijoe!. Will ensure this is passed on.

photo
photo
1

HI Mandy,


Just wondering if you had a few mins to chat on this?

We have a few questions we need to clarify before moving forward.


Thanks,

David

photo
1

For those who were unaware, this idea was actually implemented in the 7.3 published in Sept 2017.

If you have any questions/issues with this, please reach out to us.


Regards,

David

Leave a Comment
 
Attach a file