-
Notifications
You must be signed in to change notification settings - Fork 14k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[sqllab] add support for results backends (#1377)
* [sqllab] add support for results backends Long running SQL queries (beyond the scope of a web request) can now use a k/v store to hold their result sets. * Addressing comments, fixed js tests * Fixing mysql has gone away * Adressing more comments * Touchups
- Loading branch information
1 parent
7dfe891
commit 6fb3b30
Showing
27 changed files
with
784 additions
and
361 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
export const STATE_BSSTYLE_MAP = { | ||
failed: 'danger', | ||
pending: 'info', | ||
fetching: 'info', | ||
running: 'warning', | ||
stopped: 'danger', | ||
success: 'success', | ||
}; | ||
|
||
export const DATA_PREVIEW_ROW_COUNT = 100; | ||
|
||
export const STATUS_OPTIONS = ['success', 'failed', 'running']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
caravel/assets/javascripts/SqlLab/components/DataPreviewModal.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import * as Actions from '../actions'; | ||
import React from 'react'; | ||
import { bindActionCreators } from 'redux'; | ||
import { connect } from 'react-redux'; | ||
import { Modal } from 'react-bootstrap'; | ||
|
||
import ResultSet from './ResultSet'; | ||
|
||
const propTypes = { | ||
queries: React.PropTypes.object, | ||
actions: React.PropTypes.object, | ||
showDataPreviewModal: React.PropTypes.bool, | ||
dataPreviewQueryId: React.PropTypes.string, | ||
}; | ||
|
||
class DataPreviewModal extends React.Component { | ||
hide() { | ||
this.props.actions.hideDataPreview(); | ||
} | ||
render() { | ||
if (this.props.showDataPreviewModal && this.props.dataPreviewQueryId) { | ||
const query = this.props.queries[this.props.dataPreviewQueryId]; | ||
return ( | ||
<Modal | ||
show={this.props.showDataPreviewModal} | ||
onHide={this.hide.bind(this)} | ||
bsStyle="lg" | ||
> | ||
<Modal.Header closeButton> | ||
<Modal.Title> | ||
Data preview for <strong>{query.tableName}</strong> | ||
</Modal.Title> | ||
</Modal.Header> | ||
<Modal.Body> | ||
<ResultSet query={query} visualize={false} csv={false} /> | ||
</Modal.Body> | ||
</Modal> | ||
); | ||
} | ||
return null; | ||
} | ||
} | ||
DataPreviewModal.propTypes = propTypes; | ||
|
||
function mapStateToProps(state) { | ||
return { | ||
queries: state.queries, | ||
showDataPreviewModal: state.showDataPreviewModal, | ||
dataPreviewQueryId: state.dataPreviewQueryId, | ||
}; | ||
} | ||
function mapDispatchToProps(dispatch) { | ||
return { | ||
actions: bindActionCreators(Actions, dispatch), | ||
}; | ||
} | ||
|
||
export default connect(mapStateToProps, mapDispatchToProps)(DataPreviewModal); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.