Apache Drill query issue - apache-drill

In Apche Drill, Getting the error like : Error: SYSTEM ERROR: IndexOutOfBoundsException: readerIndex: 0, writerIndex: 63 (expected: 0 <= readerIndex <= writerIndex <= capacity(0)) .
The scenario is we have table in MapR and the view for the same . Any idea like when drill throw this error ? One more thing is when using flatten() function only we are facing this error.

Related

Octave error (error: max_recursion_depth exceeded) how to fix it?

I have run the following code in the Octave (Octave-6.2.0 (Local) (GUI)) and the output is shown. I have made an error intentionally, but when I fix it, it does not recognize it. Even when I have copied and pasted the following code which does not have an error it shows the same error message. By the way, it can be solved if I close Octave and open it again.
P=[1200 3000 4200 5500];
I=[10000];
function result = irrm(P,I)
result = 100*irr(P,I)
end
irrm(P,I);
Output:
>> rr
result = 11.798
The code with an error is:
P=[1200 3000 4200 5500];
I=[10000];
function result = irr(P,I)
result = 100*irr(P,I)
end
irrm(P,I);
The output of the code with an error is:
>> rr
error: max_recursion_depth exceeded
error: called from
irr
irr at line 5 column 10
irrm at line 5 column 10
rr at line 7 column 1

group_vars/all syntax error

I am having a group_var/all file whose starting lines look exactly like this :
##################################
['./roles/openssh/defaults',
'./roles/rsyslog/defaults',
'./roles/tomcat8/defaults',
'./roles/oracle_java/defaults',
'./roles/psp_db/defaults',
'./roles/provision_kill_instance/defaults',
'./roles/kill_app/defaults',
'./roles/base/defaults',
'./roles/ntp/defaults']
##################################
base_google_dns_enabled: false
when i run it as ansible-playbook provision_aws.yml it throws a error :
ERROR: Syntax Error while loading YAML script, /home/nsingh/ansible-psportal/group_vars/all
Note: The error may actually appear before this position: line 13, column 1
base_google_dns_enabled: false
According to my diagnosis , this is because of the things inside [] , even if i put this at the end of my group_vars i encounter something similar. Any Help Would be highly appreciated.
Your syntax looks incorrect. Try:
---
myroles:
- './roles/openssh/defaults'
- './roles/rsyslog/defaults'
- './roles/tomcat8/defaults'
- './roles/oracle_java/defaults'
- './roles/psp_db/defaults'
- './roles/provision_kill_instance/defaults'
- './roles/kill_app/defaults'
- './roles/base/defaults'
- './roles/ntp/defaults'
base_google_dns_enabled: false

Visualworks Cincom Smalltalk SUnit Test case for error condition

I have this piece of code.
|temp|
temp := 5
(temp < 3) ifFalse:[
self error: 'Invalid input'.
].
What will a SUnit test case look like, if I have to test that the above error is raised when I run this code?
Currently when I run the above code, it says "Unhandled exception: Invalid input"
How can I handle this exception?
Try this:
testError
|temp|
temp := 5.
self
should: [(temp < 3) ifFalse:[
self error: 'Invalid input']]
raise: Error

Doctrine2 Criteria() generate wrong MySQL query

when I use \Doctrine\Common\Collections\Criteria::create()
use Doctrine\Common\Collections\Criteria;
...
$criteria = Criteria::create();
$criteria->where(Criteria::expr()->eq('isPublished', 1))
->andWhere(Criteria::expr()->eq('isDeleted', 0));
$this->comments->matching($criteria)
and I getting error:
Message:
An exception occurred while executing 'SELECT t0.id AS id1, t0.rating AS rating2, t0.text AS text3, t0.username AS username4, t0.isPublished AS isPublished5, t0.isDeleted AS isDeleted6, t0.dateCreated AS dateCreated7, t0.userIP AS userIP8, t0.user_id AS user_id9, t0.product_id AS product_id10 FROM product_comments t0 WHERE ((t0.isPublished IS ? AND t0.isDeleted IS ?) AND t0.product_id IS ?)' with params {"1":1,"2":0,"3":1123}:
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1 AND t0.isDeleted IS 0) AND t0.product_id*IS 1123)' at line 1
The problem is operand 'IS' in where clausule. It is not MySQL operand. (If I paste this query to MySQL terminal, and change "IS" => "=" - is all right)
Why Doctrine genetate such query? Where is the problem?
I solved changing line 91 of Doctrine\ORM\Persisters\BasicEntityPersister
from
Comparison::IS => 'IS %s',
to
Comparison::IS => '= %s',
This is a bug in doctrine fixed by upgrading Doctrine ORM to 2.3.5 or later.
Bug report at http://www.doctrine-project.org/jira/browse/DDC-2471
More discussion on the problem at
https://github.com/doctrine/collections/commit/3db3ab843ff76774bee4679d4cb3a10cffb0a935#diff-757942c669bf6be9910786b2558ad745
Try replacing
expr()->eq('isPublished', 1) and expr()->eq('isPublished', 0) with
expr()->eq('isPublished', '?1')
expr()->eq('isPublished', '?0')

How to trace MySql queries using MySql-Proxy?

I just downloaded the mysql-proxy and created this script lua (found in Mysql docs):
function read_query(packet)
if string.byte(packet) == proxy.COM_QUERY then
print("QUERY: " .. string.sub(packet, 2))
end
end
This is the command-line I'm using:
mysql-proxy -P localhost:1234 -b localhost:3306 --proxy-lua-script=profile.lua --plugins=proxy
When I run a simple query (like "select * from table1"), this error is reported: "failed: .\lua-scope.c:241: stat(C:...\profile.lua) failed: No error (0)"
Note: If I run mysql-proxy without lua script, no error occurs.
I need to install something to get mysql-proxy and query tracing working?
My environment is Windows 7 Professional x64.
Sorry the bad english.
The error you're getting is caused by --proxy-lua-script pointing to a file that mysql-proxy can't find. Either you've typed the name in wrong, you've typed the path in wrong, or you are expecting it in your CWD and it's not there. Or actually, looking at the entire error a little more closely, it seems possible that mysql-proxy itself sees the file in CWD itself OK, but one of the underlying modules doesn't like it (possibly because mysql-proxy changes the CWD somehow?)
Try saving profile.lua to the root of your C: drive and trying different versions of the option like so:
--proxy-lua-script=c:\profile.lua
--proxy-lua-script=\profile.lua
--proxy-lua-script=/profile.lua
One of those would probably work
simple query log lua script:
require("mysql.tokenizer")
local fh = io.open("/var/log/mysql/proxy.query.log", "a+")
fh:setvbuf('line',4096)
local the_query = "";
local seqno = 0;
function read_query( packet )
if string.byte(packet) == proxy.COM_QUERY then
seqno = seqno + 1
the_query = (string.gsub(string.gsub(string.sub(packet, 2), "%s%s*", ' '), "^%s*(.-)%s*$", "%1"))
fh:write(string.format("%s %09d %09d : %s (%s) -- %s\n",
os.date('%Y-%m-%d %H:%M:%S'),
proxy.connection.server.thread_id,
seqno,
proxy.connection.client.username,
proxy.connection.client.default_db,
the_query))
fh:flush()
return proxy.PROXY_SEND_QUERY
else
query = ""
end
end