Skip to content

Instantly share code, notes, and snippets.

@wongster80
Created March 30, 2017 22:03
Show Gist options
  • Save wongster80/77ccee824bef558d31f6678f6a0b5107 to your computer and use it in GitHub Desktop.
Save wongster80/77ccee824bef558d31f6678f6a0b5107 to your computer and use it in GitHub Desktop.
AbstractJsonArrayUnnestFactory - modified for long varchar
class AbstractJsonArrayUnnestFactory : public TransformFunctionFactory {
public:
virtual void getPrototype(Vertica::ServerInterface &,
Vertica::ColumnTypes &argTypes,
Vertica::ColumnTypes &resTypes)
{
//argTypes.addVarchar();
//resTypes.addVarchar();
argTypes.addLongVarchar(); /* Adding long varchar data type */
resTypes.addLongVarchar();
}
virtual void getReturnType(Vertica::ServerInterface &,
const Vertica::SizedColumnTypes &argTypes,
Vertica::SizedColumnTypes &resTypes)
{
const Vertica::VerticaType &jsonSrcType = argTypes.getColumnType(0);
//resTypes.addVarchar(jsonSrcType.getStringLength(), T::resultColumnName());
resTypes.addLongVarchar(jsonSrcType.getStringLength(), T::resultColumnName()); /* Adding long varchar data type */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment