Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 215680

Summary: Joint Data Set Column Names
Product: z_Archived Reporter: Scott Rosenbaum <scottr>
Component: BIRTAssignee: Xiaoxiao Wu <xwu>
Status: VERIFIED FIXED QA Contact: Tianli Zhang <tzhang>
Severity: normal    
Priority: P3 CC: lzhu, wenfeng.fwd, whe, xxue
Version: unspecifiedKeywords: plan
Target Milestone: 2.5.1 RC2   
Hardware: PC   
OS: Windows XP   
Whiteboard: Non-Auto

Description Scott Rosenbaum CLA 2008-01-17 12:23:12 EST
The default names derived for the JointDataSet are in the form:
 originDataSet::originColumnName

When using those fields, it is far easier to work with the ColumnName only.  I think the default behavior should be for JointDataSet  columns to be just the originalColumnName, unless there is a conflict between the two datasets.  

In the event of a conflict then you add the originalDataSetName::
Comment 1 Lin Zhu CLA 2008-01-18 10:51:40 EST
We will look into the problem. Meanwhile please use column alias as a workaround.
Comment 2 Scott Rosenbaum CLA 2008-01-18 11:02:29 EST
No worries working around. It is really just a convenience thing.  If the column name is unique, you want to keep it as short as possible.  The longer column names can be come a real hassle. In particular, if you use column name only, then you have flexibility in the data-binding.  

The same table could work with different joint data sets, as long as they use the same aliases in their core queries.  If the orig_table_name is built into the column name then this won't work.

sr
Comment 3 Wenfeng Li CLA 2008-06-09 18:52:35 EDT
+1 to use the original col name by default, only if there is conflict, the join data set will add the dataset prefix for the 2nd duplicated column name.
Comment 4 Lin Zhu CLA 2009-04-17 02:44:48 EDT
As per our discussion all the joint data set enhancement will be moved to future for further consideration.
Comment 5 Lin Zhu CLA 2009-05-05 02:56:43 EDT
We can consider automatically create alias with simplified column names so that user can directly use those alias instead of column names.
Comment 6 Wenfeng Li CLA 2009-05-26 20:24:03 EDT
(In reply to comment #5)
> We can consider automatically create alias with simplified column names so that
> user can directly use those alias instead of column names.

Is it possible to use the original column name by default.  Keep a hash map for the joint data set column names,  check for duplication when adding columns to the join data set.  Add dataset prefix if there is a duplicate.
Comment 7 Lin Zhu CLA 2009-08-19 07:34:40 EDT
(In reply to comment #6)
> (In reply to comment #5)
> > We can consider automatically create alias with simplified column names so that
> > user can directly use those alias instead of column names.
> 
> Is it possible to use the original column name by default.  Keep a hash map for
> the joint data set column names,  check for duplication when adding columns to
> the join data set.  Add dataset prefix if there is a duplicate.
> 

This is the exactly algorithm we used to create alias of the joint data set column. I am reluctant to directly change the joint data set column name algorithm in 2.5.1 as the algorithm is introduce long time ago (even before we have column bindnig). As in early stage of BIRT we used not to save the joint data set column information in report design, those report design will directly depend on the legacy data set column generation algorithm during execution. I am worry about the potential backward compatibility issue.

Meanwhile, by introduce alias to the joint data set column maybe a safe and effective solution. Alias is used exactly as column names. And in BIRT UI during all the automatically generated javascript would take alias of a column for priority.
Comment 8 Xiaoxiao Wu CLA 2009-08-21 03:22:51 EDT
Considering the backward compatibility, in order to make the column name reference simplified, now we implicitly populate all the columns’ aliases instead of their names for a Joint Data Set.

If a column of the source data set already has an alias, we’ll use it for the Joint data set directly. If it is a duplicate, then we’ll use its data set name as the prefix of the alias, which ensures the alias is unique.

If a column of the source data set is not specified alias, we’ll use the simple column name as the alias. Similarly if it is a duplicate, we’ll use its data set name as the prefix.

So this bug has been fixed.
Comment 9 Tianli Zhang CLA 2009-08-23 21:42:17 EDT
Now we use alias of source data set for joint data set directly. If the column from source data set hasn't alias, we use its original name. For both alias and original name, if it is unique we will not use dataset name as prefix. Verified in 2.5.1 v20090824-0630 build.