Skip to content

Commit

Permalink
Add getColumnTypes API to RecordSink
Browse files Browse the repository at this point in the history
  • Loading branch information
nileema committed Dec 22, 2014
1 parent 0511e6b commit 4770f04
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,12 @@ public String commit()
return ""; // the committer does not need any additional info
}

@Override
public List<Type> getColumnTypes()
{
return columnTypes;
}

private int next()
{
checkState(field != -1, "not in record");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@ public String commit()
return "";
}

@Override
public List<Type> getColumnTypes()
{
return columnTypes;
}

private void append(Object value)
{
checkState(field != -1, "not in record");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ public String commit()
return ""; // the committer can list the directory
}

@Override
public List<Type> getColumnTypes()
{
return columnTypes;
}

private void append(Object value)
{
checkState(field != -1, "not in record");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,12 @@ public String commit()
return Joiner.on(':').join(nodeId, outputHandle.getShardUuid());
}

@Override
public List<Type> getColumnTypes()
{
return columnTypes;
}

private Type currentType()
{
return columnTypes.get(rowSink.currentField());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
*/
package com.facebook.presto.spi;

import com.facebook.presto.spi.type.Type;

import java.util.List;

public interface RecordSink
{
/**
Expand All @@ -34,4 +38,6 @@ public interface RecordSink
void appendString(byte[] value);

String commit();

List<Type> getColumnTypes();
}

0 comments on commit 4770f04

Please sign in to comment.