Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion scripts/image_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ echo ". /miniconda/etc/profile.d/conda.sh" >> ~/.bashrc
echo "source activate sqlflow-dev" >> ~/.bashrc

# keras.datasets.imdb only works with numpy==1.16.1
# NOTE: shap == 0.30.1 depends on dill but not include dill as it's dependency, need to install manually
source /miniconda/bin/activate sqlflow-dev && python -m pip install \
numpy==1.16.1 \
tensorflow==${TENSORFLOW_VERSION} \
Expand All @@ -36,6 +37,7 @@ notebook==6.0.0 \
sqlflow==0.4.0 \
pre-commit \
odps \
dill \
shap \
${PIP_ADD_PACKAGES}

Expand Down Expand Up @@ -121,7 +123,7 @@ pip install xgboost==0.90

# 10. install Hadoop to use as the client when writing CSV to hive tables
HADOOP_URL=https://archive.apache.org/dist/hadoop/common/stable/hadoop-${HADOOP_VERSION}.tar.gz
curl -fsSL "$HADOOP_URL" -o /tmp/hadoop.tar.gz
curl -fsSL "$HADOOP_URL" -o /tmp/hadoop.tar.gz
tar -xzf /tmp/hadoop.tar.gz -C /opt/
rm -rf /tmp/hadoop.tar.gz
rm -rf /opt/hadoop-${HADOOP_VERSION}/share/doc
Expand Down
16 changes: 8 additions & 8 deletions sql/codegen.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,13 @@ func newFiller(pr *extendedSelect, ds *trainAndValDataset, fts fieldTypes, db *D
if err != nil {
return nil, err
}
if r.Driver == "hive" {
// remove the last ';' which leads to a (hive)ParseException
r.TrainingDatasetSQL = strings.TrimSuffix(r.TrainingDatasetSQL, ";")
r.ValidationDatasetSQL = strings.TrimSuffix(r.ValidationDatasetSQL, ";")
r.PredictionDatasetSQL = strings.TrimSuffix(r.PredictionDatasetSQL, ";")
}

trainResolved, err := resolveTrainClause(&pr.trainClause, &pr.standardSelect, r.connectionConfig)
if err != nil {
return nil, err
Expand Down Expand Up @@ -229,14 +236,7 @@ func newFiller(pr *extendedSelect, ds *trainAndValDataset, fts fieldTypes, db *D
return nil, e
}
}

if err == nil && r.Driver == "hive" {
// remove the last ';' which leads to a (hive)ParseException
r.TrainingDatasetSQL = strings.TrimSuffix(r.TrainingDatasetSQL, ";")
r.ValidationDatasetSQL = strings.TrimSuffix(r.ValidationDatasetSQL, ";")
r.PredictionDatasetSQL = strings.TrimSuffix(r.PredictionDatasetSQL, ";")
}
return r, err
return r, e
}

func newConnectionConfig(db *DB) (*connectionConfig, error) {
Expand Down
1 change: 0 additions & 1 deletion sql/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,6 @@ func (cw *logChanWriter) Write(p []byte) (n int, err error) {
if err := cw.wr.Write(cw.prev); err != nil {
return len(cw.prev), err
}

cw.prev = ""
}
return n, nil
Expand Down