odbc does not return any value from hbase table

Bug #1390261 reported by Paul Chin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Trafodion
Fix Committed
High
Daniel Lu

Bug Description

The below cod, querying an Hbase table, always returns an empty string so the length of the variable Page = 0. When executing the same SQL from SQLCI, it works OK the first time; if trying the second time, SQLCI core-dumps. I then start SQLCI again and it works, but only one time before a new core dump.

This is the snipped from my aps: So the ODBC driver in line 09 indicates that there are data returned and in line 10 it’s indicated that it’s not a NULL value, but after executing line 11, the variable Page is empty. I use the same method when talking to Trafodion tables and it works just fine.

Mind you, this is the html data of up-to 32K I’m retrieving so must have something to do with the length because if I retrieve the row_id, which is only 14 CHARS, it works ok.

      01 With CMDtraf
      02 .CommandTimeout = 60
      03 .Connection.Open()
      04 .Parameters.Add("@caseid", OdbcType.Char, 14)
      05 .CommandText = "SELECT col_value from hbase.""_CELL_"".""bjcases"" WHERE row_id = ?"
      06 .Prepare()
      07 .Parameters("@caseid").Value = CaseID
      08 Dim odbcreader As OdbcDataReader = .ExecuteReader()
      09 If odbcreader.HasRows Then
      10 If Not IsDBNull(odbcreader(0)) Then
      11 Page = odbcreader(0)
      12 Dim TheBrowser = CreateObject("InternetExplorer.Application")
      13 TheBrowser.Visible = True
      14 TheBrowser.Navigate(Page)
      15 Else
      16 labAlertMsg.Text = "Case page not found in Trafodion"
      17 End If
      18 End If
      19 odbcreader.Close()
      20 .Connection.Close()
      21 End With

So these are the 3 statements I have tried in line 05 (with double “” removed. Only in the code for syntax reason.
SELECT col_value from hbase."_CELL_"."bjcases" WHERE row_id = ?
SELECT CAST(col_value AS VARCHAR(1000)) from hbase."_CELL_"."bjcases" WHERE row_id = ?
SELECT LEFT(col_value,1000) from hbase."_CELL_"."bjcases" WHERE row_id = ?

Paul Chin (pchin)
Changed in trafodion:
assignee: nobody → Paul Chin (pchin)
assignee: Paul Chin (pchin) → nobody
assignee: nobody → Trafodion General (trafodion-general)
Changed in trafodion:
assignee: Trafodion General (trafodion-general) → Anoop Sharma (anoop-sharma)
Paul Chin (pchin)
summary: - sqlci core every second time select hbase table
+ odbc does not return any value from hbase table
description: updated
tags: added: client-odbc-windows
removed: sqlci
Revision history for this message
Benny Jensen (benny-jensen) wrote :

I have a correction. I was using the wrong syntax for the select from Hbase. I have now changed it to this syntax which works just fine in sqlci returned the page information, but in ODBC it just fails. It does not even throw an error. The applications just fails back to desktop.

select column_lookup(column_details, 'page:html') from hbase."_ROW_"."bjcases" WHERE row_id = '10-141101-4988';

Revision history for this message
Anoop Sharma (anoop-sharma) wrote :

The issue of empty string seems to be in odbc driver. Could be the use of a short var to store returned length.

A simpler testcase to reproduce this from odbc would be:

  select cast('a' as char(40000)) from (values(1)) x(a);
  This will return empty string.

  select cast('a' as char(30000)) from (values(a)) x(a);
  will return data.

Changed in trafodion:
assignee: Anoop Sharma (anoop-sharma) → Arvind Narain (arvind-narain)
importance: Undecided → High
Jian Jin (jian-jin)
Changed in trafodion:
assignee: Arvind Narain (arvind-narain) → Daniel Lu (ping-lu)
Revision history for this message
Daniel Lu (ping-lu) wrote :

confirmed driver have row size < 32K limitation regarding ouput/fetch, will fix it.

not clear for input yet.

Changed in trafodion:
milestone: none → r1.0
status: New → In Progress
Daniel Lu (ping-lu)
Changed in trafodion:
status: In Progress → Fix Committed
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.