Projects >> Synapse-Repository-Services >>5988de5b29580a64738f3e7c6174efcee3ffd68f

Chunk
Conflicting content
	 */
	@Override
	public void checkForRowLevelConflict(String tableIdString, RawRowSet delta, long minVersion) throws IOException {
<<<<<<< HEAD
=======
		if (delta.getEtag() == null)
			throw new IllegalArgumentException("RowSet.etag cannot be null when rows are being updated.");
		long versionOfEtag = getVersionForEtag(tableIdString, delta.getEtag());

>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
		Iterable updatingRows = Iterables.filter(delta.getRows(), new Predicate() {
			@Override
			public boolean apply(Row row) {
Solution content
	 */
	@Override
	public void checkForRowLevelConflict(String tableIdString, RawRowSet delta, long minVersion) throws IOException {
		Iterable updatingRows = Iterables.filter(delta.getRows(), new Predicate() {
			@Override
			public boolean apply(Row row) {
File
CachingTableRowTruthDAOImpl.java
Developer's decision
Version 1
Kind of conflict
If statement
Method invocation
Variable
Chunk
Conflicting content
	 *             when a conflict is found
	 */
	public void checkForRowLevelConflict(String tableId, RawRowSet delta, long minVersion) throws IOException {
<<<<<<< HEAD
		if (delta.getEtag() != null) {
			// Lookup the version number for this update.
			long versionOfEtag = getVersionForEtag(tableId, delta.getEtag());
			long firstVersionToCheck = Math.max(minVersion - 1, versionOfEtag);
			// Check each version greater than the version for the etag
			List changes = listRowSetsKeysForTableGreaterThanVersion(tableId, firstVersionToCheck);
			// check for row level conflicts
			Set rowIds = TableModelUtils.getDistictValidRowIds(delta.getRows()).keySet();
			for (TableRowChange change : changes) {
				checkForRowLevelConflict(change, rowIds);
			}
		} else {
			// we have to check each row individually
			// Check each version greater than the min version
			List changes = listRowSetsKeysForTableGreaterThanVersion(tableId, minVersion - 1);
			// check for row level conflicts
			// we scan from highest version down and once we encounter a row, we remove it from the map, since we are only interested in comparing to the latest version
			Map rowIdsAndVersions = TableModelUtils.getDistictValidRowIds(delta.getRows());
			for (TableRowChange change : Lists.reverse(changes)) {
				checkForRowLevelConflict(change, rowIdsAndVersions);
			}
=======
		if (delta.getEtag() == null)
			throw new IllegalArgumentException("RowSet.etag cannot be null when rows are being updated.");
		// Lookup the version number for this update.
		long versionOfEtag = getVersionForEtag(tableId, delta.getEtag());
		long firstVersionToCheck = Math.max(minVersion - 1, versionOfEtag);
		// Check each version greater than the version for the etag
		List changes = listRowSetsKeysForTableGreaterThanVersion(tableId, firstVersionToCheck);
		// check for row level conflicts
		Set rowIds = TableModelUtils.getDistictValidRowIds(delta.getRows());
		for (TableRowChange change : changes) {
			checkForRowLevelConflict(change, rowIds);
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
		}
	}
Solution content
	 *             when a conflict is found
	 */
	public void checkForRowLevelConflict(String tableId, RawRowSet delta, long minVersion) throws IOException {
		if (delta.getEtag() != null) {
			// Lookup the version number for this update.
			long versionOfEtag = getVersionForEtag(tableId, delta.getEtag());
			long firstVersionToCheck = Math.max(minVersion - 1, versionOfEtag);
			// Check each version greater than the version for the etag
			List changes = listRowSetsKeysForTableGreaterThanVersion(tableId, firstVersionToCheck);
			// check for row level conflicts
			Set rowIds = TableModelUtils.getDistictValidRowIds(delta.getRows()).keySet();
			for (TableRowChange change : changes) {
				checkForRowLevelConflict(change, rowIds);
			}
		} else {
			// we have to check each row individually
			// Check each version greater than the min version
			List changes = listRowSetsKeysForTableGreaterThanVersion(tableId, minVersion - 1);
			// check for row level conflicts
			// we scan from highest version down and once we encounter a row, we remove it from the map, since we are only interested in comparing to the latest version
			Map rowIdsAndVersions = TableModelUtils.getDistictValidRowIds(delta.getRows());
			for (TableRowChange change : Lists.reverse(changes)) {
				checkForRowLevelConflict(change, rowIdsAndVersions);
			}
		}
	}
File
TableRowTruthDAOImpl.java
Developer's decision
Version 1
Kind of conflict
Comment
For statement
If statement
Method invocation
Variable
Chunk
Conflicting content
		RawRowSet toUpdateThreeRaw = new RawRowSet(set.getHeaders(), toUpdateThree.getEtag(), toUpdateThree.getTableId(),
				toUpdateThree.getRows());
		tableRowTruthDao.appendRowSetToTable(creatorUserGroupId, tableId, mapper, toUpdateThreeRaw);
<<<<<<< HEAD
	}

	@Test
	public void testAppendRowsUpdateNoConflictedNullEtag() throws IOException, NotFoundException {
		// Create some test column models
		ColumnMapper mapper = TableModelTestUtils.createMapperForOneOfEachType();
		// create some test rows.
		List rows = TableModelTestUtils.createRows(mapper.getColumnModels(), 3);
		String tableId = "syn123";
		RawRowSet set = new RawRowSet(TableModelUtils.getHeaders(mapper.getColumnModels()), null, tableId, rows);
		// Append this change set
		RowReferenceSet refSet = tableRowTruthDao.appendRowSetToTable(creatorUserGroupId, tableId, mapper, set);
		assertNotNull(refSet);
		// Now fetch the rows for an update
		RowSet toUpdateOne = tableRowTruthDao.getRowSet(tableId, 0l, ALL_SET, mapper);
		RowSet toUpdateTwo = tableRowTruthDao.getRowSet(tableId, 0l, ALL_SET, mapper);
		RowSet toUpdateThree = tableRowTruthDao.getRowSet(tableId, 0l, ALL_SET, mapper);
		// For this case each update will change a different row so there is no conflict.
		// update row one
		Row toUpdate = toUpdateOne.getRows().get(0);
		TableModelTestUtils.updateRow(mapper.getColumnModels(), toUpdate, 100);
		toUpdateOne.getRows().clear();
		toUpdateOne.getRows().add(toUpdate);
		RawRowSet toUpdateOneRaw = new RawRowSet(set.getHeaders(), toUpdateOne.getEtag(), toUpdateOne.getTableId(), toUpdateOne.getRows());
		tableRowTruthDao.appendRowSetToTable(creatorUserGroupId, tableId, mapper, toUpdateOneRaw);
		// update row two
		toUpdate = toUpdateTwo.getRows().get(1);
		TableModelTestUtils.updateRow(mapper.getColumnModels(), toUpdate, 101);
		toUpdateTwo.getRows().clear();
		toUpdateTwo.getRows().add(toUpdate);
		RawRowSet toUpdateTwoRaw = new RawRowSet(set.getHeaders(), toUpdateTwo.getEtag(), toUpdateTwo.getTableId(), toUpdateTwo.getRows());
		tableRowTruthDao.appendRowSetToTable(creatorUserGroupId, tableId, mapper, toUpdateTwoRaw);
		// update row three
		toUpdate = toUpdateThree.getRows().get(2);
		TableModelTestUtils.updateRow(mapper.getColumnModels(), toUpdate, 102);
		toUpdateThree.getRows().clear();
		toUpdateThree.getRows().add(toUpdate);
		RawRowSet toUpdateThreeRaw = new RawRowSet(set.getHeaders(), null, toUpdateThree.getTableId(), toUpdateThree.getRows());
		tableRowTruthDao.appendRowSetToTable(creatorUserGroupId, tableId, mapper, toUpdateThreeRaw);
=======
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
	}
	
	@Test
Solution content
		// Append this change set
		RawRowSet toUpdateThreeRaw = new RawRowSet(set.getHeaders(), toUpdateThree.getEtag(), toUpdateThree.getTableId(),
				toUpdateThree.getRows());
		tableRowTruthDao.appendRowSetToTable(creatorUserGroupId, tableId, mapper, toUpdateThreeRaw);
	}

	@Test
	public void testAppendRowsUpdateNoConflictedNullEtag() throws IOException, NotFoundException {
		// Create some test column models
		ColumnMapper mapper = TableModelTestUtils.createMapperForOneOfEachType();
		// create some test rows.
		List rows = TableModelTestUtils.createRows(mapper.getColumnModels(), 3);
		String tableId = "syn123";
		RawRowSet set = new RawRowSet(TableModelUtils.getHeaders(mapper.getColumnModels()), null, tableId, rows);
		RowReferenceSet refSet = tableRowTruthDao.appendRowSetToTable(creatorUserGroupId, tableId, mapper, set);
		assertNotNull(refSet);
		// Now fetch the rows for an update
		RowSet toUpdateOne = tableRowTruthDao.getRowSet(tableId, 0l, ALL_SET, mapper);
		RowSet toUpdateTwo = tableRowTruthDao.getRowSet(tableId, 0l, ALL_SET, mapper);
		RowSet toUpdateThree = tableRowTruthDao.getRowSet(tableId, 0l, ALL_SET, mapper);
		// For this case each update will change a different row so there is no conflict.
		// update row one
		Row toUpdate = toUpdateOne.getRows().get(0);
		TableModelTestUtils.updateRow(mapper.getColumnModels(), toUpdate, 100);
		toUpdateOne.getRows().clear();
		toUpdateOne.getRows().add(toUpdate);
		RawRowSet toUpdateOneRaw = new RawRowSet(set.getHeaders(), toUpdateOne.getEtag(), toUpdateOne.getTableId(), toUpdateOne.getRows());
		tableRowTruthDao.appendRowSetToTable(creatorUserGroupId, tableId, mapper, toUpdateOneRaw);
		// update row two
		toUpdate = toUpdateTwo.getRows().get(1);
		TableModelTestUtils.updateRow(mapper.getColumnModels(), toUpdate, 101);
		toUpdateTwo.getRows().clear();
		toUpdateTwo.getRows().add(toUpdate);
		RawRowSet toUpdateTwoRaw = new RawRowSet(set.getHeaders(), toUpdateTwo.getEtag(), toUpdateTwo.getTableId(), toUpdateTwo.getRows());
		tableRowTruthDao.appendRowSetToTable(creatorUserGroupId, tableId, mapper, toUpdateTwoRaw);
		// update row three
		toUpdate = toUpdateThree.getRows().get(2);
		TableModelTestUtils.updateRow(mapper.getColumnModels(), toUpdate, 102);
		toUpdateThree.getRows().clear();
		toUpdateThree.getRows().add(toUpdate);
		RawRowSet toUpdateThreeRaw = new RawRowSet(set.getHeaders(), null, toUpdateThree.getTableId(), toUpdateThree.getRows());
		tableRowTruthDao.appendRowSetToTable(creatorUserGroupId, tableId, mapper, toUpdateThreeRaw);
	}
	
	@Test
File
TableRowTruthDAOImplTest.java
Developer's decision
Version 1
Kind of conflict
Annotation
Comment
Method invocation
Method signature
Variable
Chunk
Conflicting content
		ValidateArgument.required(columnNameToModelMap, "all columns");
		ValidateArgument.required(selectList, "selectList");
		if (selectList.getAsterisk() != null) {
<<<<<<< HEAD
			throw new IllegalStateException("The columns should have been expanded before getting here");
=======
			// All of the columns will be returned.
			return TableModelUtils.createColumnMapperFromColumnModels(columnNameToModelMap, isAggregatedResult);
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
		} else {
			List selectColumnModels = Lists.newArrayListWithCapacity(selectList.getColumns().size());
			for (DerivedColumn dc : selectList.getColumns()) {
Solution content
		ValidateArgument.required(columnNameToModelMap, "all columns");
		ValidateArgument.required(selectList, "selectList");
		if (selectList.getAsterisk() != null) {
			throw new IllegalStateException("The columns should have been expanded before getting here");
		} else {
			List selectColumnModels = Lists.newArrayListWithCapacity(selectList.getColumns().size());
			for (DerivedColumn dc : selectList.getColumns()) {
File
SQLTranslatorUtils.java
Developer's decision
Version 1
Kind of conflict
Comment
Method invocation
Return statement
Throw statement
Chunk
Conflicting content
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.StringUtils;
<<<<<<< HEAD
import org.sagebionetworks.StackConfiguration;
=======
import org.sagebionetworks.repo.model.dao.table.RowAccessor;
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
import org.sagebionetworks.repo.model.jdo.KeyFactory;
import org.sagebionetworks.repo.model.table.ColumnModel;
import org.sagebionetworks.repo.model.table.ColumnType;
Solution content
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.StringUtils;
import org.sagebionetworks.StackConfiguration;
import org.sagebionetworks.repo.model.jdo.KeyFactory;
import org.sagebionetworks.repo.model.table.ColumnModel;
import org.sagebionetworks.repo.model.table.ColumnType;
File
SQLUtils.java
Developer's decision
Version 1
Kind of conflict
Import
Chunk
Conflicting content
		Map columnIndexMap = new HashMap();
		int index = 0;
		for (SelectColumn header : toBind.getHeaders()) {
<<<<<<< HEAD
			// columns might no longer exists
			if (header != null) {
				columnIndexMap.put(header.getId(), index);
			}
=======
			columnIndexMap.put(header.getId(), index);
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
			index++;
		}
Solution content
		Map columnIndexMap = new HashMap();
		int index = 0;
		for (SelectColumn header : toBind.getHeaders()) {
			// columns might no longer exists
			if (header != null) {
				columnIndexMap.put(header.getId(), index);
			}
			index++;
		}
File
SQLUtils.java
Developer's decision
Version 1
Kind of conflict
Comment
If statement
Method invocation
Chunk
Conflicting content
import org.apache.commons.lang.BooleanUtils;
import org.sagebionetworks.repo.model.table.ColumnMapper;
import org.sagebionetworks.repo.model.table.ColumnModel;
<<<<<<< HEAD
=======
import org.sagebionetworks.repo.model.table.SelectColumn;
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
import org.sagebionetworks.table.cluster.utils.TableModelUtils;
import org.sagebionetworks.table.query.ParseException;
import org.sagebionetworks.table.query.TableQueryParser;
Solution content
import org.apache.commons.lang.BooleanUtils;
import org.sagebionetworks.repo.model.table.ColumnMapper;
import org.sagebionetworks.repo.model.table.ColumnModel;
import org.sagebionetworks.repo.model.table.SelectColumn;
import org.sagebionetworks.table.cluster.utils.TableModelUtils;
import org.sagebionetworks.table.query.ParseException;
import org.sagebionetworks.table.query.TableQueryParser;
File
SqlQuery.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
import org.sagebionetworks.table.query.model.DerivedColumn;
import org.sagebionetworks.table.query.model.QuerySpecification;
import org.sagebionetworks.table.query.model.SelectList;
<<<<<<< HEAD
import org.sagebionetworks.table.query.model.visitors.GetTableNameVisitor;
import org.sagebionetworks.table.query.model.visitors.IsAggregateVisitor;
import org.sagebionetworks.util.ValidateArgument;
=======
import org.sagebionetworks.table.query.model.visitors.IsAggregateVisitor;
import org.sagebionetworks.table.query.util.SqlElementUntils;
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860

import com.google.common.base.Function;
import com.google.common.collect.Iterables;
Solution content
import org.sagebionetworks.table.query.model.DerivedColumn;
import org.sagebionetworks.table.query.model.QuerySpecification;
import org.sagebionetworks.table.query.model.SelectList;
import org.sagebionetworks.table.query.model.visitors.GetTableNameVisitor;
import org.sagebionetworks.table.query.model.visitors.IsAggregateVisitor;
import org.sagebionetworks.util.ValidateArgument;

import com.google.common.base.Function;
import com.google.common.collect.Iterables;
File
SqlQuery.java
Developer's decision
Version 1
Kind of conflict
Import
Chunk
Conflicting content
	 * @param columnNameToModelMap
	 * @throws ParseException
	 */
<<<<<<< HEAD
	public void init(QuerySpecification parsedModel, List tableSchema, String tableId) {
		ValidateArgument.required(tableSchema, "TableSchema");
		ValidateArgument.required(tableId, "tableId");
		this.tableSchema = tableSchema;
		this.model = parsedModel;
		this.tableId = tableId;

=======
	public void init(QuerySpecification parsedModel, List tableSchema) {
		if (tableSchema == null)
			throw new IllegalArgumentException("TableSchema cannot be null");
		this.tableSchema = tableSchema;
		this.model = parsedModel;
		this.tableId = SqlElementUntils.getTableId(model);
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
		// This map will contain all of the 
		this.parameters = new HashMap();	
		this.columnNameToModelMap = TableModelUtils.createColumnNameToModelMap(tableSchema);
Solution content
	 * @param columnNameToModelMap
	 * @throws ParseException
	 */
	public void init(QuerySpecification parsedModel, List tableSchema, String tableId) {
		ValidateArgument.required(tableSchema, "TableSchema");
		ValidateArgument.required(tableId, "tableId");
		this.tableSchema = tableSchema;
		this.model = parsedModel;
		this.tableId = tableId;

		// This map will contain all of the 
		this.parameters = new HashMap();	
		this.columnNameToModelMap = TableModelUtils.createColumnNameToModelMap(tableSchema);
File
SqlQuery.java
Developer's decision
Version 1
Kind of conflict
Attribute
If statement
Method invocation
Method signature
Variable
Chunk
Conflicting content
import org.sagebionetworks.repo.model.table.Row;
import org.sagebionetworks.repo.model.table.RowSet;
import org.sagebionetworks.repo.model.table.SelectColumn;
<<<<<<< HEAD
import org.sagebionetworks.repo.model.table.TableConstants;
import org.sagebionetworks.table.cluster.SQLUtils.TableType;
=======
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
import org.sagebionetworks.table.cluster.utils.TableModelUtils;
import org.sagebionetworks.util.ValidateArgument;
import org.springframework.dao.InvalidDataAccessResourceUsageException;
Solution content
import org.sagebionetworks.repo.model.table.Row;
import org.sagebionetworks.repo.model.table.RowSet;
import org.sagebionetworks.repo.model.table.SelectColumn;
import org.sagebionetworks.repo.model.table.TableConstants;
import org.sagebionetworks.table.cluster.SQLUtils.TableType;
import org.sagebionetworks.table.cluster.utils.TableModelUtils;
import org.sagebionetworks.util.ValidateArgument;
import org.springframework.dao.InvalidDataAccessResourceUsageException;
File
TableIndexDAOImpl.java
Developer's decision
Version 1
Kind of conflict
Import
Chunk
Conflicting content
import com.google.common.base.Function;
import com.google.common.collect.Lists;
<<<<<<< HEAD
=======
import com.google.common.collect.Maps;
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860

public class TableIndexDAOImpl implements TableIndexDAO {
Solution content

import com.google.common.base.Function;
import com.google.common.collect.Lists;
public class TableIndexDAOImpl implements TableIndexDAO {
File
TableIndexDAOImpl.java
Developer's decision
Version 1
Kind of conflict
Import
Chunk
Conflicting content
				size += calculateMaxSizeForType(scm.getColumnType(), scm.getColumnModel().getMaximumSize());
			} else {
				// we don't know the max size, now what?
<<<<<<< HEAD
				size += calculateMaxSizeForType(scm.getColumnType(), MAX_ALLOWED_STRING_SIZE);
=======
				size += calculateMaxSizeForType(scm.getColumnType(), 2000L);
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
			}
		}
		return size;
Solution content
				size += calculateMaxSizeForType(scm.getColumnType(), scm.getColumnModel().getMaximumSize());
			} else {
				// we don't know the max size, now what?
				size += calculateMaxSizeForType(scm.getColumnType(), MAX_ALLOWED_STRING_SIZE);
			}
		}
		return size;
File
TableModelUtils.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Variable
Chunk
Conflicting content
		};
	}

<<<<<<< HEAD
=======
	public static ColumnMapper createColumnMapperFromColumnModels(LinkedHashMap columnIdToModelMap, boolean isAggregate) {
		LinkedHashMap columnIdMap = Maps.newLinkedHashMap();
		for (Entry entry : columnIdToModelMap.entrySet()) {
			columnIdMap.put(entry.getKey(), createSelectColumnAndModel(entry.getValue(), isAggregate));
		}
		return createColumnMapper(columnIdMap);
	}

>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
	public static ColumnModelMapper createSingleColumnColumnMapper(ColumnModel column, boolean isAggregate) {
		return createColumnModelColumnMapper(Collections. singletonList(column), isAggregate);
	}
Solution content
		};
	}

	public static ColumnModelMapper createSingleColumnColumnMapper(ColumnModel column, boolean isAggregate) {
		return createColumnModelColumnMapper(Collections. singletonList(column), isAggregate);
	}
File
TableModelUtils.java
Developer's decision
Version 1
Kind of conflict
Method declaration
Chunk
Conflicting content
import org.sagebionetworks.repo.model.dbo.dao.table.TableModelTestUtils;
import org.sagebionetworks.repo.model.table.ColumnModel;
import org.sagebionetworks.repo.model.table.ColumnType;
<<<<<<< HEAD
import org.sagebionetworks.repo.model.table.SelectColumn;
=======
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
import org.sagebionetworks.table.cluster.utils.TableModelUtils;
import org.sagebionetworks.table.query.ParseException;
import org.sagebionetworks.table.query.model.ColumnReference;
Solution content
import org.sagebionetworks.repo.model.dbo.dao.table.TableModelTestUtils;
import org.sagebionetworks.repo.model.table.ColumnModel;
import org.sagebionetworks.repo.model.table.ColumnType;
import org.sagebionetworks.repo.model.table.SelectColumn;

import org.sagebionetworks.table.cluster.utils.TableModelUtils;
import org.sagebionetworks.table.query.ParseException;
import org.sagebionetworks.table.query.model.ColumnReference;
File
SQLQueryTest.java
Developer's decision
Version 1
Kind of conflict
Import
Chunk
Conflicting content
	@Test
	public void testSelectDistinct() throws ParseException{
		SqlQuery translator = new SqlQuery("select distinct foo, bar from syn123", tableSchema);
<<<<<<< HEAD
		assertEquals("SELECT DISTINCT _C111_, _C333_ FROM T123", translator.getOutputSQL());
		assertTrue(translator.isAggregatedResult());
		List expectedSelect = Lists.newArrayList(TableModelUtils.createSelectColumn("foo", ColumnType.STRING, null),
				TableModelUtils.createSelectColumn("bar", ColumnType.STRING, null));
		assertEquals(expectedSelect, translator.getSelectColumnModels().getSelectColumns());
=======
		assertEquals("SELECT DISTINCT _C111_, _C333_, ROW_ID, ROW_VERSION FROM T123", translator.getOutputSQL());
		assertFalse(translator.isAggregatedResult());
		List expectedSelect = Arrays.asList(columnNameToModelMap.get("foo"), columnNameToModelMap.get("bar"));
		assertEquals(expectedSelect, translator.getSelectColumnModels().getColumnModels());
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
	}
	
	@Test
Solution content
	@Test
	public void testSelectDistinct() throws ParseException{
		SqlQuery translator = new SqlQuery("select distinct foo, bar from syn123", tableSchema);
		assertEquals("SELECT DISTINCT _C111_, _C333_ FROM T123", translator.getOutputSQL());
		assertTrue(translator.isAggregatedResult());
		List expectedSelect = Lists.newArrayList(TableModelUtils.createSelectColumn("foo", ColumnType.STRING, null),
				TableModelUtils.createSelectColumn("bar", ColumnType.STRING, null));
		assertEquals(expectedSelect, translator.getSelectColumnModels().getSelectColumns());
	}
	
	@Test
File
SQLQueryTest.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Variable
Chunk
Conflicting content
		SqlQuery translator = new SqlQuery("select avg(inttype) from syn123", tableSchema);
		assertEquals("SELECT AVG(_C888_) FROM T123", translator.getOutputSQL());
		assertTrue(translator.isAggregatedResult());
<<<<<<< HEAD
		assertEquals(Lists.newArrayList(TableModelUtils.createSelectColumn("AVG(inttype)", ColumnType.DOUBLE, null)), translator
=======
		assertEquals(Lists.newArrayList(TableModelUtils.createSelectColumn("AVG(inttype)", ColumnType.INTEGER, null)), translator
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
				.getSelectColumnModels().getSelectColumns());
	}
	
Solution content
		SqlQuery translator = new SqlQuery("select avg(inttype) from syn123", tableSchema);
		assertEquals("SELECT AVG(_C888_) FROM T123", translator.getOutputSQL());
		assertTrue(translator.isAggregatedResult());
		assertEquals(Lists.newArrayList(TableModelUtils.createSelectColumn("AVG(inttype)", ColumnType.DOUBLE, null)), translator
				.getSelectColumnModels().getSelectColumns());
	}
	
File
SQLQueryTest.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
		SqlQuery translator = new SqlQuery("select avg(inttype), bar from syn123", tableSchema);
		assertEquals("SELECT AVG(_C888_), _C333_ FROM T123", translator.getOutputSQL());
		assertTrue(translator.isAggregatedResult());
<<<<<<< HEAD
		assertEquals(Lists.newArrayList(TableModelUtils.createSelectColumn("AVG(inttype)", ColumnType.DOUBLE, null),
=======
		assertEquals(Lists.newArrayList(TableModelUtils.createSelectColumn("AVG(inttype)", ColumnType.INTEGER, null),
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
				TableModelUtils.createSelectColumn("bar", ColumnType.STRING, null)), translator.getSelectColumnModels().getSelectColumns());
	}
Solution content
		SqlQuery translator = new SqlQuery("select avg(inttype), bar from syn123", tableSchema);
		assertEquals("SELECT AVG(_C888_), _C333_ FROM T123", translator.getOutputSQL());
		assertTrue(translator.isAggregatedResult());
		assertEquals(Lists.newArrayList(TableModelUtils.createSelectColumn("AVG(inttype)", ColumnType.DOUBLE, null),
				TableModelUtils.createSelectColumn("bar", ColumnType.STRING, null)), translator.getSelectColumnModels().getSelectColumns());
	}
File
SQLQueryTest.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
				.getSelectColumns().get(4));
	}

<<<<<<< HEAD
=======
	@Test(expected = IllegalArgumentException.class)
	public void testTypeSetFunctionCannotAvgString() throws Exception {
		new SqlQuery("select avg(foo) from syn123", tableSchema);
	}

>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
	@Test
	public void testTypeSetFunctionIntegers() throws Exception {
		SqlQuery translator = new SqlQuery("select min(inttype), max(inttype), sum(inttype), avg(inttype), count(inttype) from syn123",
Solution content
				.getSelectColumns().get(4));
	}

	@Test
	public void testTypeSetFunctionIntegers() throws Exception {
		SqlQuery translator = new SqlQuery("select min(inttype), max(inttype), sum(inttype), avg(inttype), count(inttype) from syn123",
File
SQLQueryTest.java
Developer's decision
Version 1
Kind of conflict
Annotation
Method declaration
Chunk
Conflicting content
				.getSelectColumns().get(1));
		assertEquals(TableModelUtils.createSelectColumn("SUM(inttype)", ColumnType.INTEGER, null), translator.getSelectColumnModels()
				.getSelectColumns().get(2));
<<<<<<< HEAD
		assertEquals(TableModelUtils.createSelectColumn("AVG(inttype)", ColumnType.DOUBLE, null), translator.getSelectColumnModels()
=======
		assertEquals(TableModelUtils.createSelectColumn("AVG(inttype)", ColumnType.INTEGER, null), translator.getSelectColumnModels()
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
				.getSelectColumns().get(3));
		assertEquals(TableModelUtils.createSelectColumn("COUNT(inttype)", ColumnType.INTEGER, null), translator.getSelectColumnModels()
				.getSelectColumns().get(4));
Solution content
				.getSelectColumns().get(1));
		assertEquals(TableModelUtils.createSelectColumn("SUM(inttype)", ColumnType.INTEGER, null), translator.getSelectColumnModels()
				.getSelectColumns().get(2));
		assertEquals(TableModelUtils.createSelectColumn("AVG(inttype)", ColumnType.DOUBLE, null), translator.getSelectColumnModels()
				.getSelectColumns().get(3));
		assertEquals(TableModelUtils.createSelectColumn("COUNT(inttype)", ColumnType.INTEGER, null), translator.getSelectColumnModels()
				.getSelectColumns().get(4));
File
SQLQueryTest.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
import org.sagebionetworks.ImmutablePropertyAccessor;
import org.sagebionetworks.StackConfiguration;
import org.sagebionetworks.repo.model.dbo.dao.table.TableModelTestUtils;
<<<<<<< HEAD
=======
import org.sagebionetworks.table.cluster.SQLUtils.TableType;
import org.sagebionetworks.table.cluster.utils.TableModelUtils;
import org.sagebionetworks.repo.model.table.ColumnMapper;
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
import org.sagebionetworks.repo.model.table.ColumnModel;
import org.sagebionetworks.repo.model.table.ColumnType;
import org.sagebionetworks.repo.model.table.IdRange;
Solution content
import org.sagebionetworks.ImmutablePropertyAccessor;
import org.sagebionetworks.StackConfiguration;
import org.sagebionetworks.repo.model.dbo.dao.table.TableModelTestUtils;
import org.sagebionetworks.repo.model.table.ColumnModel;
import org.sagebionetworks.repo.model.table.ColumnType;
import org.sagebionetworks.repo.model.table.IdRange;
File
TableIndexDAOImplTest.java
Developer's decision
Version 1
Kind of conflict
Import
Chunk
Conflicting content
import org.sagebionetworks.repo.model.table.Row;
import org.sagebionetworks.repo.model.table.RowSet;
import org.sagebionetworks.repo.model.table.SelectColumn;
<<<<<<< HEAD
import org.sagebionetworks.table.cluster.SQLUtils.TableType;
import org.sagebionetworks.table.cluster.TableIndexDAO.ColumnDefinition;
import org.sagebionetworks.table.cluster.utils.TableModelUtils;
=======
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
import org.sagebionetworks.table.query.ParseException;
import org.sagebionetworks.util.ReflectionStaticTestUtils;
import org.springframework.beans.factory.annotation.Autowired;
Solution content
import org.sagebionetworks.repo.model.table.Row;
import org.sagebionetworks.repo.model.table.RowSet;
import org.sagebionetworks.repo.model.table.SelectColumn;
import org.sagebionetworks.table.cluster.SQLUtils.TableType;
import org.sagebionetworks.table.cluster.TableIndexDAO.ColumnDefinition;
import org.sagebionetworks.table.cluster.utils.TableModelUtils;
import org.sagebionetworks.table.query.ParseException;
import org.sagebionetworks.util.ReflectionStaticTestUtils;
import org.springframework.beans.factory.annotation.Autowired;
File
TableIndexDAOImplTest.java
Developer's decision
Version 1
Kind of conflict
Import
Chunk
Conflicting content
package org.sagebionetworks.table.query.model;

<<<<<<< HEAD
=======
import org.sagebionetworks.table.query.model.visitors.IsAggregateVisitor;
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
import org.sagebionetworks.table.query.model.visitors.Visitor;

Solution content
package org.sagebionetworks.table.query.model;

import org.sagebionetworks.table.query.model.visitors.Visitor;

File
NumericPrimary.java
Developer's decision
Version 1
Kind of conflict
Import
Chunk
Conflicting content
			visit(valueExpressionPrimary, visitor);
		} else {
			visit(numericValueFunction, visitor);
<<<<<<< HEAD
=======
		}
	}

	public void visit(IsAggregateVisitor visitor) {
		if (valueExpressionPrimary != null) {
			visit(valueExpressionPrimary, visitor);
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
		}
	}
}
Solution content
		} else {
			visit(valueExpressionPrimary, visitor);
			visit(numericValueFunction, visitor);
		}
	}
}
File
NumericPrimary.java
Developer's decision
Version 1
Kind of conflict
If statement
Method invocation
Method signature
Chunk
Conflicting content
import org.sagebionetworks.repo.model.table.ColumnType;
import org.sagebionetworks.table.query.model.visitors.ColumnTypeVisitor;
<<<<<<< HEAD
import org.sagebionetworks.table.query.model.visitors.IsAggregateVisitor;
=======
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
import org.sagebionetworks.table.query.model.visitors.ToSimpleSqlVisitor;
import org.sagebionetworks.table.query.model.visitors.Visitor;
Solution content
import org.sagebionetworks.repo.model.table.ColumnType;
import org.sagebionetworks.table.query.model.visitors.ColumnTypeVisitor;
import org.sagebionetworks.table.query.model.visitors.IsAggregateVisitor;
import org.sagebionetworks.table.query.model.visitors.ToSimpleSqlVisitor;
import org.sagebionetworks.table.query.model.visitors.Visitor;
File
NumericValueFunction.java
Developer's decision
Version 1
Kind of conflict
Import
Chunk
Conflicting content
		default:
			throw new IllegalArgumentException("unexpected mysqlFuntion");
		}
<<<<<<< HEAD
	}

	public void visit(IsAggregateVisitor visitor) {
		visitor.setIsAggregate();
=======
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
	}
}
Solution content
		default:
			throw new IllegalArgumentException("unexpected mysqlFuntion");
		}
	}

	public void visit(IsAggregateVisitor visitor) {
		visitor.setIsAggregate();
	}
}
File
NumericValueFunction.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Method signature
Chunk
Conflicting content
package org.sagebionetworks.table.query.model;

<<<<<<< HEAD
import org.sagebionetworks.table.query.model.visitors.GetTableNameVisitor;
=======
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
import org.sagebionetworks.table.query.model.visitors.IsAggregateVisitor;
import org.sagebionetworks.table.query.model.visitors.ToSimpleSqlVisitor;
import org.sagebionetworks.table.query.model.visitors.Visitor;
Solution content
package org.sagebionetworks.table.query.model;

import org.sagebionetworks.table.query.model.visitors.GetTableNameVisitor;
import org.sagebionetworks.table.query.model.visitors.IsAggregateVisitor;
import org.sagebionetworks.table.query.model.visitors.ToSimpleSqlVisitor;
import org.sagebionetworks.table.query.model.visitors.Visitor;
File
QuerySpecification.java
Developer's decision
Version 1
Kind of conflict
Import
Chunk
Conflicting content
	
	public void visit(Visitor visitor) {
		visit(selectList, visitor);
<<<<<<< HEAD
		if (tableExpression != null) {
			visit(tableExpression, visitor);
		}
=======
		visit(tableExpression, visitor);
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
	}

	public void visit(ToSimpleSqlVisitor visitor) {
Solution content
	
	public void visit(Visitor visitor) {
		visit(selectList, visitor);
		if (tableExpression != null) {
			visit(tableExpression, visitor);
		}
	}

	public void visit(ToSimpleSqlVisitor visitor) {
File
QuerySpecification.java
Developer's decision
Version 1
Kind of conflict
If statement
Method invocation
Chunk
Conflicting content
			visitor.append(" ");
			visitor.append(sqlDirective.name());
		}
<<<<<<< HEAD
		if (setQuantifier != null) {
			visitor.append(" ");
			visitor.append(setQuantifier.name());
		}
		visitor.append(" ");
		visit(selectList, visitor);
		if (tableExpression != null) {
			visitor.append(" ");
			visit(tableExpression, visitor);
		}
	}

	public void visit(IsAggregateVisitor visitor) {
		if (setQuantifier == SetQuantifier.DISTINCT) {
			visitor.setIsAggregate();
		}
		if (tableExpression != null) {
			visit(tableExpression, visitor);
		}
		visit(selectList, visitor);
	}

	public void visit(GetTableNameVisitor visitor) {
		if (tableExpression != null) {
			visit(tableExpression, visitor);
		}
=======
		if(setQuantifier != null){
			visitor.append(" ");
			visitor.append(setQuantifier.name());
		}
		visitor.append(" ");
		visit(selectList, visitor);
		visitor.append(" ");
		visit(tableExpression, visitor);
	}

	public void visit(IsAggregateVisitor visitor) {
		visit(tableExpression, visitor);
		visit(selectList, visitor);
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
	}
}
Solution content
			visitor.append(" ");
			visitor.append(sqlDirective.name());
		}
		if (setQuantifier != null) {
			visitor.append(" ");
			visitor.append(setQuantifier.name());
		}
		visitor.append(" ");
		visit(selectList, visitor);
		if (tableExpression != null) {
			visitor.append(" ");
			visit(tableExpression, visitor);
		}
	}

	public void visit(IsAggregateVisitor visitor) {
		if (setQuantifier == SetQuantifier.DISTINCT) {
			visitor.setIsAggregate();
		}
		if (tableExpression != null) {
			visit(tableExpression, visitor);
		}
		visit(selectList, visitor);
	}

	public void visit(GetTableNameVisitor visitor) {
		if (tableExpression != null) {
			visit(tableExpression, visitor);
		}
	}
}
File
QuerySpecification.java
Developer's decision
Version 1
Kind of conflict
If statement
Method declaration
Method invocation
Method signature
Chunk
Conflicting content
 */
public abstract class SQLElement {

<<<<<<< HEAD
	/**
	 * override this method for the default tree crawl. Override this method with more specific visitors for alternate
	 * tree crawl behaviours
	 * 
	 * @param visitor
	 */
	public abstract void visit(Visitor visitor);

	/**
	 * Call from visit(visitor) method to continue tree crawl
	 * 
	 * @param sqlElement
	 * @param visitor
	 */
=======
	public abstract void visit(Visitor visitor);

>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
	protected void visit(SQLElement sqlElement, Visitor visitor) {
		Method m = IntrospectionUtils.findNearestMethod(sqlElement, "visit", visitor);
		try {
Solution content
 */
public abstract class SQLElement {

	/**
	 * override this method for the default tree crawl. Override this method with more specific visitors for alternate
	 * tree crawl behaviours
	 * 
	 * @param visitor
	 */
	public abstract void visit(Visitor visitor);

	/**
	 * Call from visit(visitor) method to continue tree crawl
	 * 
	 * @param sqlElement
	 * @param visitor
	 */
	protected void visit(SQLElement sqlElement, Visitor visitor) {
		Method m = IntrospectionUtils.findNearestMethod(sqlElement, "visit", visitor);
		try {
File
SQLElement.java
Developer's decision
Version 1
Kind of conflict
Comment
Method interface
Chunk
Conflicting content
	}

	/**
<<<<<<< HEAD
	 * visit this element and its children with the specified visitor. Usage:
	 * 
	 * 
	 * TableNameVisitor visitor = new TableNameVisitor();
	 * model.doVisit(visitor);
	 * String tableName = visitor.getTableName();
	 * 
* * or, the shorter version: * *
	 * model.doVisit(new TableNameVisitor()).getTableName();
	 * 
* ======= * visit this element and its children. * >>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860 * @param visitor */ public V doVisit(V visitor) {
Solution content
	 * 
	 * 
	}

	/**
	 * visit this element and its children with the specified visitor. Usage:
	 * TableNameVisitor visitor = new TableNameVisitor();
	 * model.doVisit(visitor);
	 * String tableName = visitor.getTableName();
	 * 
* * or, the shorter version: * *
	 * model.doVisit(new TableNameVisitor()).getTableName();
	 * 
* * @param visitor */ public V doVisit(V visitor) {
File
SQLElement.java
Developer's decision
Version 1
Kind of conflict
Comment
Chunk
Conflicting content
				visit(valueExpression, visitor);
				break;
			case SUM:
<<<<<<< HEAD
=======
			case AVG:
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
				// the type is the type of the underlying value, only valid for numbers
				visit(valueExpression, visitor);
				if (visitor.getColumnType() != null
Solution content
				visit(valueExpression, visitor);
				break;
			case SUM:
				// the type is the type of the underlying value, only valid for numbers
				visit(valueExpression, visitor);
				if (visitor.getColumnType() != null
File
SetFunctionSpecification.java
Developer's decision
Version 1
Kind of conflict
Case statement
Chunk
Conflicting content
							+ visitor.getColumnType().name());
				}
				break;
<<<<<<< HEAD
			case AVG:
				// averages for integers actually come back as doubles
				visitor.setColumnType(ColumnType.DOUBLE);
				break;
=======
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
			default:
				throw new IllegalArgumentException("unhandled set function type");
			}
Solution content
							+ visitor.getColumnType().name());
				}
				break;
			case AVG:
				// averages for integers actually come back as doubles
				visitor.setColumnType(ColumnType.DOUBLE);
				break;
			default:
				throw new IllegalArgumentException("unhandled set function type");
			}
File
SetFunctionSpecification.java
Developer's decision
Version 1
Kind of conflict
Break statement
Case statement
Comment
Method invocation
Chunk
Conflicting content
	}

	public void visit(Visitor visitor) {
<<<<<<< HEAD
		visit(valueExpressionPrimary, visitor);
=======
		visit(columnReference, visitor);
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
	}
}
Solution content
	}

	public void visit(Visitor visitor) {
		visit(valueExpressionPrimary, visitor);
	}
}
File
SortKey.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
package org.sagebionetworks.table.query.model;

<<<<<<< HEAD
import org.sagebionetworks.table.query.model.visitors.GetTableNameVisitor;
=======
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
import org.sagebionetworks.table.query.model.visitors.IsAggregateVisitor;
import org.sagebionetworks.table.query.model.visitors.ToSimpleSqlVisitor;
import org.sagebionetworks.table.query.model.visitors.Visitor;
Solution content
package org.sagebionetworks.table.query.model;

import org.sagebionetworks.table.query.model.visitors.GetTableNameVisitor;
import org.sagebionetworks.table.query.model.visitors.IsAggregateVisitor;
import org.sagebionetworks.table.query.model.visitors.ToSimpleSqlVisitor;
import org.sagebionetworks.table.query.model.visitors.Visitor;
File
TableExpression.java
Developer's decision
Version 1
Kind of conflict
Import
Chunk
Conflicting content
			visitor.setIsAggregate();
		}
	}
<<<<<<< HEAD

	public void visit(GetTableNameVisitor visitor) {
		visit(fromClause, visitor);
	}
=======
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
}
Solution content
			visitor.setIsAggregate();
		}
	}

	public void visit(GetTableNameVisitor visitor) {
		visit(fromClause, visitor);
	}
}
File
TableExpression.java
Developer's decision
Version 1
Kind of conflict
Method declaration
Chunk
Conflicting content
package org.sagebionetworks.table.query.model;

<<<<<<< HEAD
import org.sagebionetworks.table.query.model.visitors.GetTableNameVisitor;
=======
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
import org.sagebionetworks.table.query.model.visitors.ToSimpleSqlVisitor;
import org.sagebionetworks.table.query.model.visitors.ToTranslatedSqlVisitor;
import org.sagebionetworks.table.query.model.visitors.Visitor;
Solution content
package org.sagebionetworks.table.query.model;

import org.sagebionetworks.table.query.model.visitors.GetTableNameVisitor;
import org.sagebionetworks.table.query.model.visitors.ToSimpleSqlVisitor;
import org.sagebionetworks.table.query.model.visitors.ToTranslatedSqlVisitor;
import org.sagebionetworks.table.query.model.visitors.Visitor;
File
TableReference.java
Developer's decision
Version 1
Kind of conflict
Import
Chunk
Conflicting content
	public void visit(ToTranslatedSqlVisitor visitor) {
		visitor.convertTableName(tableName);
	}
<<<<<<< HEAD

	public void visit(GetTableNameVisitor visitor) {
		visitor.setTableName(tableName);
	}
=======
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
}
Solution content
	public void visit(ToTranslatedSqlVisitor visitor) {
		visitor.convertTableName(tableName);
	}

	public void visit(GetTableNameVisitor visitor) {
		visitor.setTableName(tableName);
	}
}
File
TableReference.java
Developer's decision
Version 1
Kind of conflict
Method declaration
Chunk
Conflicting content
			// need to preserve order, so use linked hash map
			originalSortSpecifications = Maps.newLinkedHashMap();
			for (SortSpecification spec : orderByClause.getSortSpecificationList().getSortSpecifications()) {
<<<<<<< HEAD
				String columnName = spec.getSortKey().getValueExpressionPrimary().toString();
=======
				String columnName = spec.getSortKey().getColumnReference().toString();
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
				originalSortSpecifications.put(columnName, spec);
			}
		}
Solution content
			// need to preserve order, so use linked hash map
			originalSortSpecifications = Maps.newLinkedHashMap();
			for (SortSpecification spec : orderByClause.getSortSpecificationList().getSortSpecifications()) {
				String columnName = spec.getSortKey().getValueExpressionPrimary().toString();
				originalSortSpecifications.put(columnName, spec);
			}
		}
File
SqlElementUntils.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Variable
Chunk
Conflicting content
<<<<<<< HEAD
		DerivedColumn column = new DerivedColumn(valueExpression, null);
		List columns = Lists.newArrayList(column);
		SelectList selectList = new SelectList(columns);
		QuerySpecification element = new QuerySpecification(null, null, selectList, null);
		assertEquals("SELECT FOUND_ROWS()", element.toString());
		assertNull(element.doVisit(new GetTableNameVisitor()).getTableName());
=======
		TableExpression tableExpression = SqlElementUntils.createTableExpression("from syn123");
		QuerySpecification element = new QuerySpecification(null, null, selectList, tableExpression);
		assertEquals("SELECT FOUND_ROWS() FROM syn123", element.toString());
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
	}

	@Test
Solution content
		DerivedColumn column = new DerivedColumn(valueExpression, null);
		List columns = Lists.newArrayList(column);
		SelectList selectList = new SelectList(columns);
		QuerySpecification element = new QuerySpecification(null, null, selectList, null);
		assertEquals("SELECT FOUND_ROWS()", element.toString());
		assertNull(element.doVisit(new GetTableNameVisitor()).getTableName());
	}

	@Test
File
QuerySpecificationTest.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Variable
Chunk
Conflicting content
		TableExpression tableExpression = SqlElementUntils.createTableExpression("from syn123");
		QuerySpecification element = new QuerySpecification(null, null, selectList, tableExpression);
		assertEquals("SELECT FOUND_ROWS() FROM syn123", element.toString());
<<<<<<< HEAD
		assertEquals("syn123", element.doVisit(new GetTableNameVisitor()).getTableName());
=======
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
	}
}
Solution content
		TableExpression tableExpression = SqlElementUntils.createTableExpression("from syn123");
		QuerySpecification element = new QuerySpecification(null, null, selectList, tableExpression);
		assertEquals("SELECT FOUND_ROWS() FROM syn123", element.toString());
		assertEquals("syn123", element.doVisit(new GetTableNameVisitor()).getTableName());
	}
}
File
QuerySpecificationTest.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
			batchSizeBytes += maxBytesPerRow;
			if(batchSizeBytes >= maxBytesPerChangeSet){
				// Validate there aren't any illegal file handle replaces
<<<<<<< HEAD
				validateFileHandles(user, tableId, columnMapper, delta.getRows());
=======
				validateFileHandles(user, tableId, columnMapper, delta, etag);
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
				// Send this batch and keep the etag.
				etag = appendBatchOfRowsToTable(user, columnMapper, delta, results, progressCallback);
				// Clear the batch
Solution content
			batchSizeBytes += maxBytesPerRow;
			if(batchSizeBytes >= maxBytesPerChangeSet){
				// Validate there aren't any illegal file handle replaces
				validateFileHandles(user, tableId, columnMapper, delta.getRows());
				// Send this batch and keep the etag.
				etag = appendBatchOfRowsToTable(user, columnMapper, delta, results, progressCallback);
				// Clear the batch
File
TableRowManagerImpl.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
		// Send the last batch is there are any rows
		if(!batch.isEmpty()){
			// Validate there aren't any illegal file handle replaces
<<<<<<< HEAD
			validateFileHandles(user, tableId, columnMapper, delta.getRows());
=======
			validateFileHandles(user, tableId, columnMapper, delta, etag);
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
			etag = appendBatchOfRowsToTable(user, columnMapper, delta, results, progressCallback);
		}
		// The table has change so we must reset the state.
Solution content
		// Send the last batch is there are any rows
		if(!batch.isEmpty()){
			// Validate there aren't any illegal file handle replaces
			validateFileHandles(user, tableId, columnMapper, delta.getRows());
			etag = appendBatchOfRowsToTable(user, columnMapper, delta, results, progressCallback);
		}
		// The table has change so we must reset the state.
File
TableRowManagerImpl.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
		this.maxBytesPerRequest = maxBytesPerRequest;
	}

<<<<<<< HEAD
	private void validateFileHandles(UserInfo user, String tableId, ColumnMapper columnMapper, List rows)
=======
	private void validateFileHandles(UserInfo user, String tableId, ColumnMapper columnMapper, RawRowSet delta, String etag)
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
			throws IOException,
			NotFoundException {
Solution content
		this.maxBytesPerRequest = maxBytesPerRequest;
	}

	private void validateFileHandles(UserInfo user, String tableId, ColumnMapper columnMapper, List rows)
			throws IOException,
			NotFoundException {
File
TableRowManagerImpl.java
Developer's decision
Version 1
Kind of conflict
Method signature
Chunk
Conflicting content
			return;
		}

<<<<<<< HEAD
		RowSetAccessor fileHandlesToCheckAccessor = TableModelUtils.getRowSetAccessor(rows, columnMapper);
=======
		RowSetAccessor fileHandlesToCheckAccessor = TableModelUtils.getRowSetAccessor(delta.getRows(), columnMapper);
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860

		// eliminate all file handles that are owned by current user
		Set ownedFileHandles = Sets.newHashSet();
Solution content
			return;
		}

		RowSetAccessor fileHandlesToCheckAccessor = TableModelUtils.getRowSetAccessor(rows, columnMapper);
		// eliminate all file handles that are owned by current user
		Set ownedFileHandles = Sets.newHashSet();
File
TableRowManagerImpl.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Variable
Chunk
Conflicting content
		assertEquals(ColumnType.DOUBLE, queryResult.getQueryResults().getHeaders().get(0).getColumnType());
		assertEquals("ss", queryResult.getQueryResults().getHeaders().get(0).getName());
		compareValues(new String[] { "1.5", "4.5", "6" }, queryResult.getQueryResults());
<<<<<<< HEAD

		sql = "select sum(number) from " + tableId + " group by number order by sum(number) asc";
		queryResult = waitForConsistentQuery(adminUserInfo, sql, null, null);
		assertEquals(ColumnType.DOUBLE, queryResult.getQueryResults().getHeaders().get(0).getColumnType());
		assertEquals("SUM(number)", queryResult.getQueryResults().getHeaders().get(0).getName());
		compareValues(new String[] { "1.5", "4.5", "6" }, queryResult.getQueryResults());
=======
>>>>>>> d1e16a2e9c824f22228dded6ac8399e932fa6860
	}

	@Test(expected = IllegalArgumentException.class)
Solution content
		assertEquals(ColumnType.DOUBLE, queryResult.getQueryResults().getHeaders().get(0).getColumnType());
		assertEquals("ss", queryResult.getQueryResults().getHeaders().get(0).getName());
		compareValues(new String[] { "1.5", "4.5", "6" }, queryResult.getQueryResults());

		sql = "select sum(number) from " + tableId + " group by number order by sum(number) asc";
		queryResult = waitForConsistentQuery(adminUserInfo, sql, null, null);
		assertEquals(ColumnType.DOUBLE, queryResult.getQueryResults().getHeaders().get(0).getColumnType());
		assertEquals("SUM(number)", queryResult.getQueryResults().getHeaders().get(0).getName());
		compareValues(new String[] { "1.5", "4.5", "6" }, queryResult.getQueryResults());
	}

	@Test(expected = IllegalArgumentException.class)
File
TableWorkerIntegrationTest.java
Developer's decision
Version 1
Kind of conflict
Attribute
Method invocation
Variable