Error: INTERNAL: VIAssert(list->length > 0) failed

Moderator: NorbertKrupa

Post Reply
User avatar
Jbaskin
Intermediate
Intermediate
Posts: 61
Joined: Sat Jan 28, 2012 1:21 pm

Error: INTERNAL: VIAssert(list->length > 0) failed

Post by Jbaskin » Tue Aug 07, 2012 3:15 pm

Hi guys,

I'm getting a weird error when trying to convert an integer sum to a float via the CAST command.

This works:

Code: Select all

dbadmin=> SELECT d.dname, e.ename, e.sal,
dbadmin->        round(sal / sum(cast(e.sal as float)) OVER (PARTITION BY e.dname),2) sal_dept_ratio
dbadmin-> FROM emp e, dept d
dbadmin-> WHERE e.dname = d.dname;
   dname    | ename  | sal  | sal_dept_ratio
------------+--------+------+---------------
 ACCOUNTING | CLARK  | 2450 |           0.28
 ACCOUNTING | MILLER | 1300 |           0.15
 ACCOUNTING | KING   | 5000 |           0.57
 RESEARCH   | ADAMS  | 1100 |            0.1
 RESEARCH   | SMITH  |  800 |           0.07
 RESEARCH   | JONES  | 2975 |           0.27
 RESEARCH   | FORD   | 3000 |           0.28
 RESEARCH   | SCOTT  | 3000 |           0.28
 SALES      | ALLEN  | 1600 |           0.17
 SALES      | JAMES  |  950 |            0.1
 SALES      | MARTIN | 1250 |           0.13
 SALES      | BLAKE  | 2850 |            0.3
 SALES      | TURNER | 1500 |           0.16
 SALES      | WARD   | 1250 |           0.13
(14 rows)
But if I CAST the SUM I get some weird Vertica error:

Code: Select all

dbadmin=> SELECT d.dname, e.ename, e.sal,
dbadmin->        round(sal / cast(sum(e.sal) as float) OVER (PARTITION BY e.dname),2) sal_dept_ratio
dbadmin-> FROM emp e, dept d
dbadmin-> WHERE e.dname = d.dname;
INTERNAL:  VIAssert(list->length > 0) failed
DETAIL:  list.c: 39
HINT:  Please report this error to Vertica; try restating your query
Anyone else see error?

thanks!

jpcavanaugh
Intermediate
Intermediate
Posts: 149
Joined: Mon Apr 30, 2012 10:04 pm
Location: New York
Contact:

Re: Error: INTERNAL: VIAssert(list->length > 0) failed

Post by jpcavanaugh » Tue Aug 07, 2012 8:19 pm

I would open a support request with vertica for this. What version are you using?

User avatar
Jbaskin
Intermediate
Intermediate
Posts: 61
Joined: Sat Jan 28, 2012 1:21 pm

Re: Error: INTERNAL: VIAssert(list->length > 0) failed

Post by Jbaskin » Wed Aug 08, 2012 12:32 am

Hi foo,

The issue is occurring in version 5.0.11 of the Vertica database.

I'll open a ticket and let everyone know what I find out!

Thanks!

User avatar
becky
Intermediate
Intermediate
Posts: 118
Joined: Sat Apr 28, 2012 11:37 am

Re: Error: INTERNAL: VIAssert(list->length > 0) failed

Post by becky » Wed Aug 08, 2012 1:24 pm

jbaskin,

Any chance of posting the code you used to create the tables so that I can test if this issue exists in Vertica 6?
THANKS - BECKSTER

User avatar
Jbaskin
Intermediate
Intermediate
Posts: 61
Joined: Sat Jan 28, 2012 1:21 pm

Re: Error: INTERNAL: VIAssert(list->length > 0) failed

Post by Jbaskin » Thu Aug 09, 2012 1:03 pm

Becky,

Thanks for your interest in this odd error...

Here is a script to use to create the tables with data... the queries I used are at the bottom.

Code: Select all

create table emp (ename varchar(100), sal int, dname varchar(100));
create table dept (dname varchar(100));

insert into dept values ('ACCOUNTING');
insert into dept values ('RESEARCH');
insert into dept values ('SALES');

insert into emp values ('CLARK', 2450, 'ACCOUNTING');
insert into emp values ('MILLER', 1300, 'ACCOUNTING');
insert into emp values ('KING', 5000, 'ACCOUNTING');
insert into emp values ('ADAMS', 1100, 'RESEARCH');
insert into emp values ('SMITH', 800, 'RESEARCH');
insert into emp values ('JONES', 2975, 'RESEARCH');
insert into emp values ('FORD', 3000, 'RESEARCH');
insert into emp values ('SCOTT', 3000, 'RESEARCH');
insert into emp values ('ALLEN', 1600, 'SALES');
insert into emp values ('JAMES', 950, 'SALES');
insert into emp values ('MARTIN', 1250, 'SALES');
insert into emp values ('BLAKE', 2850, 'SALES');
insert into emp values ('TURNER', 1500, 'SALES');
insert into emp values ('WARD', 1250, 'SALES');

SELECT d.dname, e.ename, e.sal,
       round(sal / sum(cast(e.sal as float)) OVER (PARTITION BY e.dname),2) sal_dept_ratio
  FROM emp e, dept d
 WHERE e.dname = d.dname;

SELECT d.dname, e.ename, e.sal,
       round(sal / cast(sum(e.sal) as float) OVER (PARTITION BY e.dname),2) sal_dept_ratio
  FROM emp e, dept d
 WHERE e.dname = d.dname;

Post Reply

Return to “Vertica Error Codes”