com.akiban.sql.parser.ParseException: Encountered "" for complex SQL

Bug #1862283 reported by RAGAVENDRAN RAMADOSS
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Akiban SQL Parser
New
Undecided
Unassigned

Bug Description

SQL Template:
-------------

select IS_VOD_TELECAST, count(1), 1, AVG(TELECAST_REPORT_DURATION) as avgTelReportDuration,
SUM(TELECAST_REPORT_DURATION) as sumTelReportDuration, count(distinct TELECAST_BROADCAST_DATE) as distDates,
count(distinct PROGRAM_LONG_NAME) as distPgmNameCount, count(distinct PROGRAM_DISTRIBUTOR_ID) as pgmDistID,
max(TELECAST_BROADCAST_DATE)as maxDate, count(distinct (convert(varchar(10),PROGRAM_ID)) + (convert(varchar(20),EPISODE_ID))) as distPgmEpisodeCount

I am using Akiban SQLParser to parse the above sql code snippet, and it fails with below error exactly at the point where CONVERT starts within DISTINCT.

final SQLParser sqlParser = new SQLParser();
final StatementNode statementNode = sqlParser.parseStatement(formattedSQL);
Caused by: com.akiban.sql.parser.ParseException: Encountered "" at line 4, column 58.

When i run the same query without the "count(distinct (convert(varchar(10),PROGRAM_ID)) + (convert(varchar(20),EPISODE_ID))) as distPgmEpisodeCount", everything works just fine.

However, this SQL syntax works perfectly fine with Sybase.

Is this a bug? If so, can this be fixed?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.