question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TreasureData connector could not include non-ascii code query in some case.

See original GitHub issue

Issue Summary

Hi, I’m trying to query Treasure Data including NON-ASCII characters. But it could not execute and another data storage works fine.(e.f. MySQL …)

Steps to Reproduce

  1. Using TreasureData and execute the query in below.
  • NG case
select
    time AS "日付" -- non-ascii character.
from
    raw
limit 1
  • OK case
select
    time AS "datetime" 
from
    raw
limit 1
  1. An error has occurred and could not show query.
Error running query: 'ascii' codec can't encode characters in position 3-4: ordinal not in range(128)

Technical details:

  • Redash Version: Redash 2.0.0+b2990
  • Browser/OS: Chrome
  • How did you install Redash: wget and using ubuntu.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
toru-takahashicommented, Sep 1, 2017

I’m not familiar with Python’s encoding issue. But, as a possible workaround is to create sitecustomize.py in python2.7/site-packages/sitecustomize.py.

import sys
sys.setdefaultencoding('UTF8')

I found one blog which says similar issue. (Japanese) > https://www.yamamanx.com/redash-encode-error/

I could get the correct result. But, I’m not sure this works well for redash.

>>> columns_data = [(row[0], cursor.show_job()['hive_result_schema'][i][1]) for i,row in enumerate(cursor.description)]
>>>
>>> print(columns_data)
[(u'\u65e5\u4ed8', u'integer')]
1reaction
toru-takahashicommented, Sep 1, 2017

Good to hear!

Read more comments on GitHub >

github_iconTop Results From Across the Web

FTP Server Import Integration - Treasure Data: Documentation
Use this data connector to directly import data from your FTP server to Treasure Data. For sample workflows on importing data from your...
Read more >
Find non-ASCII characters in varchar columns using SQL Server
Here is a solution for the single column search using PATINDEX. It also displays the StartPosition, InvalidCharacter and ASCII code.
Read more >
Query to find rows containing ASCII characters in a given range
I'm looking for a self-contained query that will select rows with one or more characters in a range between two CHAR() numbers, regardless...
Read more >
exploratory-io/exploratory_func source: R/system.R - Rdrr.io
For Windows, set encoding to make sure non-ascii data is handled properly. ... the user does not have access permission, some database throws...
Read more >
Prepare data with Spark SQL: DataRobot docs
On the Add menu, Prepare data with Spark SQL lets you prepare a new dataset from a single dataset or blend several datasets...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found