Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import fails for murmur2 package #17

Open
jimymodi opened this issue Oct 12, 2018 · 2 comments
Open

import fails for murmur2 package #17

jimymodi opened this issue Oct 12, 2018 · 2 comments

Comments

@jimymodi
Copy link

Hello,

I am trying to import murmur2 package as a library in Redshift database. I did following steps

  1. Run the module packer
    $ ./installPipModuleAsRedshiftLibrary.sh -m murmur2 -s s3://path/to/murmur2/lib

  2. Create library on redshift

CREATE OR REPLACE LIBRARY murmur2
LANGUAGE plpythonu
from 's3://path/to/murmur2/lib/murmur2.zip'
WITH CREDENTIALS AS 'aws_access_key_id=AAAAAAAAAAAAAAAAAAAA;aws_secret_access_key=SSSSSSSSSSSSSSSSS'
region 'us-east-1';

  1. Create function and query
create OR REPLACE function f_py_kafka_partitioner (s varchar, ps int)
  returns int
stable
as $$
  import murmur2
  m2 = murmur2.murmur64a(s, len(s), 0x9747b28c)
  return m2 % ps

$$ language plpythonu;

SELECT f_py_kafka_partitioner('jiimit', 100);

This gives following error :

[Amazon](500310) Invalid operation: ImportError: No module named murmur2. Please look at svl_udf_log for more information
Details: 
 -----------------------------------------------
  error:  ImportError: No module named murmur2. Please look at svl_udf_log for more information
  code:      10000
  context:   UDF
  query:     0
  location:  udf_client.cpp:366
  process:   padbmaster [pid=31381]
  -----------------------------------------------;

@IanMeyers
Copy link
Contributor

What platform are you building on?

@jimymodi
Copy link
Author

jimymodi commented Dec 9, 2018

@IanMeyers I am building it on Ubuntu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants