sqlparser/post.cpp
// Post conversion when all tokens processed
Post conversion when all tokens processed
Post conversion when all tokens processed
void SqlParser::Post()
{
	if(_target != SQL_GREENPLUM)
		return;
	Book *bookmark = _bookmarks.GetFirstNoCurrent();
	while(bookmark != NULL)
	{
		if(_target == SQL_GREENPLUM)
		{
			if(bookmark->type == BOOK_CTC_ALL_END && bookmark->distributed_by == false)
				Append(bookmark->book, " DISTRIBUTED RANDOMLY", L" DISTRIBUTED RANDOMLY", 21);
			else
			if(bookmark->type == BOOK_CI_START)
				Prepend(bookmark->book, "/* ", L"/* ", 3);
			else
			if(bookmark->type == BOOK_CI_END)
				Append(bookmark->book, " */", L" */", 3);
		}
		bookmark = bookmark->next;
	}
}
void SqlParser :: Post ( ) { if ( _target != SQL_GREENPLUM ) return ; Book * bookmark = _bookmarks . GetFirstNoCurrent ( ) ; while ( bookmark != NULL ) { if ( _target == SQL_GREENPLUM ) { if ( bookmark -> type == BOOK_CTC_ALL_END && bookmark -> distributed_by == false ) Append ( bookmark -> book , " " , L" " , 21 ) ; else if ( bookmark -> type == BOOK_CI_START ) Prepend ( bookmark -> book , " " , L" " , 3 ) ; else if ( bookmark -> type == BOOK_CI_END ) Append ( bookmark -> book , " " , L" " , 3 ) ; } bookmark = bookmark -> next ; } }
Post conversion when all tokens processed
Post conversion when all tokens processed
// Iterate through bookmarks // Greenplum // Add DISTRIBUTED RANDOMLY for tables that are still without DISTRIBUTED clause // Comment out indexes // Comment out indexes