[jira] [Commented] (MADLIB-1018) Fix K-means support for array input for data points

2017-02-01 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/MADLIB-1018?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15849007#comment-15849007
 ] 

ASF GitHub Bot commented on MADLIB-1018:


Github user orhankislal closed the pull request at:

https://github.com/apache/incubator-madlib/pull/89


> Fix K-means support for array input for data points
> ---
>
> Key: MADLIB-1018
> URL: https://issues.apache.org/jira/browse/MADLIB-1018
> Project: Apache MADlib
>  Issue Type: Bug
>  Components: Module: k-Means Clustering
>Reporter: Frank McQuillan
>Priority: Minor
> Fix For: v1.10
>
>
> For k-means, normally you should be able to do array[col1, col2…] for the 2nd 
> parameter, but that does not work.  This JIRA is to be able to support 
> array[col1, col2…].
> {code}
> expr_point
> TEXT. The name of the column with point coordinates.
> {code}
> {code}
> SELECT madlib.kmeans_random('customers_train',
>'array[creditamount, accountbalance]',
>3
>  );
> {code}
> produces
> {code}
> ---
> InternalError Traceback (most recent call last)
>  in ()
> > 1 get_ipython().run_cell_magic(u'sql', u'', u"\nSELECT 
> madlib.kmeans_random('customers_train',\n   'array[creditamount, 
> accountbalance]',\n   3\n );\n")
> /Users/fmcquillan/anaconda/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc
>  in run_cell_magic(self, magic_name, line, cell)
>2291 magic_arg_s = self.var_expand(line, stack_depth)
>2292 with self.builtin_trap:
> -> 2293 result = fn(magic_arg_s, cell)
>2294 return result
>2295 
> /Users/fmcquillan/anaconda/lib/python2.7/site-packages/sql/magic.pyc in 
> execute(self, line, cell, local_ns)
> /Users/fmcquillan/anaconda/lib/python2.7/site-packages/IPython/core/magic.pyc 
> in (f, *a, **k)
> 191 # but it's overkill for just that one bit of state.
> 192 def magic_deco(arg):
> --> 193 call = lambda f, *a, **k: f(*a, **k)
> 194 
> 195 if callable(arg):
> /Users/fmcquillan/anaconda/lib/python2.7/site-packages/sql/magic.pyc in 
> execute(self, line, cell, local_ns)
> /Users/fmcquillan/anaconda/lib/python2.7/site-packages/IPython/core/magic.pyc 
> in (f, *a, **k)
> 191 # but it's overkill for just that one bit of state.
> 192 def magic_deco(arg):
> --> 193 call = lambda f, *a, **k: f(*a, **k)
> 194 
> 195 if callable(arg):
> /Users/fmcquillan/anaconda/lib/python2.7/site-packages/sql/magic.pyc in 
> execute(self, line, cell, local_ns)
>  78 return self._persist_dataframe(parsed['sql'], conn, 
> user_ns)
>  79 try:
> ---> 80 result = sql.run.run(conn, parsed['sql'], self, user_ns)
>  81 return result
>  82 except (ProgrammingError, OperationalError) as e:
> /Users/fmcquillan/anaconda/lib/python2.7/site-packages/sql/run.pyc in 
> run(conn, sql, config, user_namespace)
> 270 raise Exception("ipython_sql does not support 
> transactions")
> 271 txt = sqlalchemy.sql.text(statement)
> --> 272 result = conn.session.execute(txt, user_namespace)
> 273 try:
> 274 conn.session.execute('commit')
> /Users/fmcquillan/anaconda/lib/python2.7/site-packages/sqlalchemy/engine/base.pyc
>  in execute(self, object, *multiparams, **params)
> 912 type(object))
> 913 else:
> --> 914 return meth(self, multiparams, params)
> 915 
> 916 def _execute_function(self, func, multiparams, params):
> /Users/fmcquillan/anaconda/lib/python2.7/site-packages/sqlalchemy/sql/elements.pyc
>  in _execute_on_connection(self, connection, multiparams, params)
> 321 
> 322 def _execute_on_connection(self, connection, multiparams, params):
> --> 323 return connection._execute_clauseelement(self, multiparams, 
> params)
> 324 
> 325 def unique_params(self, *optionaldict, **kwargs):
> /Users/fmcquillan/anaconda/lib/python2.7/site-packages/sqlalchemy/engine/base.pyc
>  in _execute_clauseelement(self, elem, multiparams, params)
>1008 compiled_sql,
>1009 distilled_params,
> -> 1010 compiled_sql, distilled_params
>1011 )
>1012 if self._has_events or self.engine._has_events:
> /Users/fmcquillan/anaconda/lib/python2.7/site-packages/sqlalchemy/engine/base.pyc
>  in _execute_context(self, dialect, constructor, statement, parameters, *args)
>1144 parameters,
>1145 cursor,
> -> 1146 context)

[jira] [Commented] (MADLIB-1018) Fix K-means support for array input for data points

2016-12-21 Thread Frank McQuillan (JIRA)

[ 
https://issues.apache.org/jira/browse/MADLIB-1018?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15767969#comment-15767969
 ] 

Frank McQuillan commented on MADLIB-1018:
-

i.e., this means accept an expression

> Fix K-means support for array input for data points
> ---
>
> Key: MADLIB-1018
> URL: https://issues.apache.org/jira/browse/MADLIB-1018
> Project: Apache MADlib
>  Issue Type: Bug
>  Components: Module: k-Means Clustering
>Reporter: Frank McQuillan
>Priority: Minor
> Fix For: v1.10
>
>
> For k-means, normally you should be able to do array[col1, col2…] for the 2nd 
> parameter, but that does not work.  This JIRA is to be able to support 
> array[col1, col2…].
> {code}
> expr_point
> TEXT. The name of the column with point coordinates.
> {code}
> {code}
> SELECT madlib.kmeans_random('customers_train',
>'array[creditamount, accountbalance]',
>3
>  );
> {code}
> produces
> {code}
> ---
> InternalError Traceback (most recent call last)
>  in ()
> > 1 get_ipython().run_cell_magic(u'sql', u'', u"\nSELECT 
> madlib.kmeans_random('customers_train',\n   'array[creditamount, 
> accountbalance]',\n   3\n );\n")
> /Users/fmcquillan/anaconda/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc
>  in run_cell_magic(self, magic_name, line, cell)
>2291 magic_arg_s = self.var_expand(line, stack_depth)
>2292 with self.builtin_trap:
> -> 2293 result = fn(magic_arg_s, cell)
>2294 return result
>2295 
> /Users/fmcquillan/anaconda/lib/python2.7/site-packages/sql/magic.pyc in 
> execute(self, line, cell, local_ns)
> /Users/fmcquillan/anaconda/lib/python2.7/site-packages/IPython/core/magic.pyc 
> in (f, *a, **k)
> 191 # but it's overkill for just that one bit of state.
> 192 def magic_deco(arg):
> --> 193 call = lambda f, *a, **k: f(*a, **k)
> 194 
> 195 if callable(arg):
> /Users/fmcquillan/anaconda/lib/python2.7/site-packages/sql/magic.pyc in 
> execute(self, line, cell, local_ns)
> /Users/fmcquillan/anaconda/lib/python2.7/site-packages/IPython/core/magic.pyc 
> in (f, *a, **k)
> 191 # but it's overkill for just that one bit of state.
> 192 def magic_deco(arg):
> --> 193 call = lambda f, *a, **k: f(*a, **k)
> 194 
> 195 if callable(arg):
> /Users/fmcquillan/anaconda/lib/python2.7/site-packages/sql/magic.pyc in 
> execute(self, line, cell, local_ns)
>  78 return self._persist_dataframe(parsed['sql'], conn, 
> user_ns)
>  79 try:
> ---> 80 result = sql.run.run(conn, parsed['sql'], self, user_ns)
>  81 return result
>  82 except (ProgrammingError, OperationalError) as e:
> /Users/fmcquillan/anaconda/lib/python2.7/site-packages/sql/run.pyc in 
> run(conn, sql, config, user_namespace)
> 270 raise Exception("ipython_sql does not support 
> transactions")
> 271 txt = sqlalchemy.sql.text(statement)
> --> 272 result = conn.session.execute(txt, user_namespace)
> 273 try:
> 274 conn.session.execute('commit')
> /Users/fmcquillan/anaconda/lib/python2.7/site-packages/sqlalchemy/engine/base.pyc
>  in execute(self, object, *multiparams, **params)
> 912 type(object))
> 913 else:
> --> 914 return meth(self, multiparams, params)
> 915 
> 916 def _execute_function(self, func, multiparams, params):
> /Users/fmcquillan/anaconda/lib/python2.7/site-packages/sqlalchemy/sql/elements.pyc
>  in _execute_on_connection(self, connection, multiparams, params)
> 321 
> 322 def _execute_on_connection(self, connection, multiparams, params):
> --> 323 return connection._execute_clauseelement(self, multiparams, 
> params)
> 324 
> 325 def unique_params(self, *optionaldict, **kwargs):
> /Users/fmcquillan/anaconda/lib/python2.7/site-packages/sqlalchemy/engine/base.pyc
>  in _execute_clauseelement(self, elem, multiparams, params)
>1008 compiled_sql,
>1009 distilled_params,
> -> 1010 compiled_sql, distilled_params
>1011 )
>1012 if self._has_events or self.engine._has_events:
> /Users/fmcquillan/anaconda/lib/python2.7/site-packages/sqlalchemy/engine/base.pyc
>  in _execute_context(self, dialect, constructor, statement, parameters, *args)
>1144 parameters,
>1145 cursor,
> -> 1146 context)
>1147 
>1148 if self._has_events or